#ifndef MYDTANALYZER_H #define MYDTANALYZER_H /******* \class MyDTAnalyzer ******* * * Description: * * detailed description * * \author : A.Calderon 26/10/2007 * $date : 12/11/2007 CET $ * * Modification: *********************************/ /* Base Class Headers */ #include "FWCore/Framework/interface/EDAnalyzer.h" #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h" #include "DataFormats/DTRecHit/interface/DTRecSegment2DCollection.h" #include "DataFormats/DTRecHit/interface/DTSLRecSegment2D.h" #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h" #include "DataFormats/TrackReco/interface/Track.h" #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" #include "RecoMuon/TrackingTools/interface/MuonUpdatorAtVertex.h" #include "TMatrixD.h" #include "DataFormats/CLHEP/interface/AlgebraicObjects.h" #include "Geometry/DTGeometry/interface/DTGeometry.h" namespace edm { class ParameterSet; class Event; class EventSetup; } /* Collaborating Class Declarations */ #include "DataFormats/Common/interface/Handle.h" class TFile; class TH1F; class TH2F; class DTLayerId; class DTSuperLayerId; class DTChamberId; class DTTTrigBaseSync; /* C++ Headers */ #include #include namespace edm { class ParameterSet; class Event; class EventSetup; } typedef std::vector RecHitVector; typedef std::vector< std::vector > intDVector; /* ====================================================================== */ /* Class MyDTAnalyzer Interface */ class MyDTAnalyzer : public edm::EDAnalyzer { public: /* Constructor */ MyDTAnalyzer(const edm::ParameterSet& pset) ; /* Destructor */ ~MyDTAnalyzer() ; /* Operations */ void analyze(const edm::Event & event, const edm::EventSetup& eventSetup); private: void analyzeHits(const edm::Event & event, const edm::EventSetup& eventSetup); void analyzeSegs(const edm::Event & event, const edm::EventSetup& eventSetup); void analyzeSA(const edm::Event & event, const edm::EventSetup& eventSetup); double extrapolate(char*,const DTRecSegment4D, const DTRecSegment4D,edm::ESHandle &); void calculateResiduals(long, int, int, const GeomDet*,DTRecSegment4D, TrajectoryStateOnSurface ); DTRecSegment4D matchSegs(Propagator *, TrajectoryStateOnSurface, edm::ESHandle &,std::vector); const DTRecSegment4D& getBestSegment(const DTRecSegment4DCollection::range& ) const; const DTRecSegment2D& getBestSegment(const DTRecSegment2DCollection::range& ) const; LocalPoint extrapolate(const DTRecSegment4D& seg1, const DTChamberId& id2) const; LocalPoint extrapolate(const DTSLRecSegment2D&, const DTSuperLayerId&) const; TH1F* histo(const std::string& name) const; TH2F* histo2d(const std::string& name) const; void createTH1F(const std::string& name, const std::string& title, const std::string& suffix, int nbin, const double& binMin, const double& binMax) const; void createTH2F(const std::string& name, const std::string& title, const std::string& suffix, int nBinX, const double& binXMin, const double& binXMax, int nBinY, const double& binYMin, const double& binYMax) const ; std::string toString(const DTLayerId& id) const; std::string toString(const DTSuperLayerId& id) const; std::string toString(const DTChamberId& id) const; template std::string hName(const std::string& s, const T& id) const; private: bool debug; int verbosity; int _ev; bool printout; std::string theRootFileName; TFile* theFile; std::string theRecHits4DLabel; std::string theRecHits2DLabel; std::string theRecHits1DLabel; std::string theSTAMuonLabel; bool isMC; edm::InputTag theSimTrackLabel; bool doHits; bool doSegs; bool doSA; double theChi2Cut; edm::ESHandle dtGeom; edm::Handle segs; double phiMB1; double phiMB2; double xMB1; double xMB2; int theRawId; int theSubDet; int theStation; const GeomDet* geomDet; DTRecSegment4D seg; TrajectoryStateOnSurface destiny_; GlobalPoint theGlobalPosition; GlobalVector theGlobalDirection; LocalPoint theLocalPosition; LocalError theLocalPositionError; LocalVector theLocalDirection; LocalError theLocalDirectionError; GlobalPoint thePredictedGlobalPosition; GlobalVector thePredictedGlobalDirection; LocalPoint thePredictedLocalPosition; LocalVector thePredictedLocalDirection; TMatrixD theResiduals; double theResidualRPhi; double theResidualZ; double theResidualPhi; double theResidualTheta; double theResidual; bool validPoint; std::vector segSATrack_; std::vector isSegSATrack_; DTTTrigBaseSync *theSync; const static int NDOFTrack = 5; const static int NDOFAlign = 2; const static int NDOFChamber = 4; const static int NDOFCoor = 2; protected: Propagator *thePropagator1; }; #endif // DTANALYZER_H