diff --git a/Validation/RecoTrack/interface/MultiTrackValidator.h b/Validation/RecoTrack/interface/MultiTrackValidator.h index 1b16820a7c082..482d66cd0393c 100644 --- a/Validation/RecoTrack/interface/MultiTrackValidator.h +++ b/Validation/RecoTrack/interface/MultiTrackValidator.h @@ -25,19 +25,19 @@ #include "DataFormats/Common/interface/ValueMap.h" #include "DataFormats/Candidate/interface/Candidate.h" - class PileupSummaryInfo; namespace reco { -class DeDxData; + class DeDxData; } struct MultiTrackValidatorHistograms { MTVHistoProducerAlgoForTrackerHistograms histoProducerAlgo; - std::vector h_reco_coll, h_assoc_coll, h_assoc2_coll, h_simul_coll, h_looper_coll, h_pileup_coll; + std::vector h_reco_coll, h_assoc_coll, h_assoc2_coll, h_simul_coll, h_looper_coll, + h_pileup_coll; }; class MultiTrackValidator : public DQMGlobalEDAnalyzer { - public: +public: using Histograms = MultiTrackValidatorHistograms; /// Constructor @@ -46,14 +46,12 @@ class MultiTrackValidator : public DQMGlobalEDAnalyzer associators; @@ -62,17 +60,17 @@ class MultiTrackValidator : public DQMGlobalEDAnalyzer label_tp_effic_refvector; edm::EDGetTokenT label_tp_fake_refvector; edm::EDGetTokenT label_tv; - edm::EDGetTokenT > label_pileupinfo; + edm::EDGetTokenT> label_pileupinfo; - std::vector > > simHitTokens_; + std::vector>> simHitTokens_; std::vector label; - std::vector > > labelToken; - std::vector > > labelTokenSeed; - edm::EDGetTokenT bsSrc; + std::vector>> labelToken; + std::vector>> labelTokenSeed; + edm::EDGetTokenT bsSrc; - edm::EDGetTokenT > m_dEdx1Tag; - edm::EDGetTokenT > m_dEdx2Tag; + edm::EDGetTokenT> m_dEdx1Tag; + edm::EDGetTokenT> m_dEdx2Tag; std::string parametersDefiner; @@ -94,16 +92,19 @@ class MultiTrackValidator : public DQMGlobalEDAnalyzer histoProducerAlgo_; - private: - const TrackingVertex::LorentzVector *getSimPVPosition(const edm::Handle& htv) const; - const reco::Vertex::Point *getRecoPVPosition(const edm::Event& event, const edm::Handle& htv) const; - void tpParametersAndSelection(const Histograms& histograms, - const TrackingParticleRefVector& tPCeff, - const ParametersDefinerForTP& parametersDefinerTP, - const edm::Event& event, const edm::EventSetup& setup, - const reco::BeamSpot& bs, - std::vector >& momVert_tPCeff, - std::vector& selected_tPCeff) const; +private: + const TrackingVertex::LorentzVector* getSimPVPosition(const edm::Handle& htv) const; + const reco::Vertex::Point* getRecoPVPosition(const edm::Event& event, + const edm::Handle& htv) const; + void tpParametersAndSelection( + const Histograms& histograms, + const TrackingParticleRefVector& tPCeff, + const ParametersDefinerForTP& parametersDefinerTP, + const edm::Event& event, + const edm::EventSetup& setup, + const reco::BeamSpot& bs, + std::vector>& momVert_tPCeff, + std::vector& selected_tPCeff) const; size_t tpDR(const TrackingParticleRefVector& tPCeff, const std::vector& selected_tPCeff, DynArray& dR_tPCeff, @@ -119,21 +120,21 @@ class MultiTrackValidator : public DQMGlobalEDAnalyzer> associatormapStRs; std::vector> associatormapRtSs; - edm::EDGetTokenT > tpNLayersToken_; - edm::EDGetTokenT > tpNPixelLayersToken_; - edm::EDGetTokenT > tpNStripStereoLayersToken_; - + edm::EDGetTokenT> tpNLayersToken_; + edm::EDGetTokenT> tpNPixelLayersToken_; + edm::EDGetTokenT> tpNStripStereoLayersToken_; using MVACollection = std::vector; using QualityMaskCollection = std::vector; - std::vector, edm::EDGetTokenT > > > mvaQualityCollectionTokens_; + std::vector, edm::EDGetTokenT>>> + mvaQualityCollectionTokens_; std::string dirName_; bool useGsf; const double simPVMaxZ_; - edm::EDGetTokenT > cores_; + edm::EDGetTokenT> cores_; double ptMinJet_; // select tracking particles //(i.e. "denominator" of the efficiency ratio) @@ -143,10 +144,9 @@ class MultiTrackValidator : public DQMGlobalEDAnalyzer dRTrackSelector; edm::EDGetTokenT _simHitTpMapTag; - edm::EDGetTokenT > labelTokenForDrCalculation; - edm::EDGetTokenT > recoVertexToken_; + edm::EDGetTokenT> labelTokenForDrCalculation; + edm::EDGetTokenT> recoVertexToken_; edm::EDGetTokenT vertexAssociatorToken_; }; - #endif diff --git a/Validation/RecoTrack/interface/MultiTrackValidatorGenPs.h b/Validation/RecoTrack/interface/MultiTrackValidatorGenPs.h index 0671f08811956..424349dd8f079 100644 --- a/Validation/RecoTrack/interface/MultiTrackValidatorGenPs.h +++ b/Validation/RecoTrack/interface/MultiTrackValidatorGenPs.h @@ -12,24 +12,21 @@ #include "SimDataFormats/Associations/interface/TrackToGenParticleAssociator.h" class MultiTrackValidatorGenPs : public MultiTrackValidator { - public: +public: /// Constructor MultiTrackValidatorGenPs(const edm::ParameterSet& pset); - + /// Destructor ~MultiTrackValidatorGenPs() override; /// Method called once per event - void dqmAnalyze(const edm::Event&, const edm::EventSetup&, const Histograms& ) const override; + void dqmAnalyze(const edm::Event&, const edm::EventSetup&, const Histograms&) const override; private: - - GenParticleCustomSelector gpSelector; + GenParticleCustomSelector gpSelector; edm::EDGetTokenT label_gen_associator; edm::EDGetTokenT associatormapGtR; edm::EDGetTokenT associatormapRtG; - }; - #endif diff --git a/Validation/RecoTrack/interface/SiPixelTrackingRecHitsValid.h b/Validation/RecoTrack/interface/SiPixelTrackingRecHitsValid.h index 55df6cac79a2b..d1d570a4569fd 100644 --- a/Validation/RecoTrack/interface/SiPixelTrackingRecHitsValid.h +++ b/Validation/RecoTrack/interface/SiPixelTrackingRecHitsValid.h @@ -30,7 +30,7 @@ #include "TrackingTools/KalmanUpdators/interface/KFUpdator.h" #include "TrackingTools/TrackFitters/interface/KFTrajectoryFitter.h" #include "TrackingTools/TrackFitters/interface/KFTrajectorySmoother.h" -#include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h" +#include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h" #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" @@ -49,12 +49,12 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" //--- for SimHit association -#include "SimDataFormats/TrackingHit/interface/PSimHit.h" -#include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" +#include "SimDataFormats/TrackingHit/interface/PSimHit.h" +#include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" #include "Geometry/CommonTopologies/interface/PixelTopology.h" #include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h" -#include "Geometry/CommonDetUnit/interface/GeomDetType.h" -#include "Geometry/CommonDetUnit/interface/GeomDet.h" +#include "Geometry/CommonDetUnit/interface/GeomDetType.h" +#include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonDetUnit/interface/GluedGeomDet.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" @@ -66,24 +66,23 @@ class TTree; class TFile; -class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer -{ - public: - +class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer { +public: explicit SiPixelTrackingRecHitsValid(const edm::ParameterSet& conf); - + ~SiPixelTrackingRecHitsValid() override; void analyze(const edm::Event& e, const edm::EventSetup& c) override; - void bookHistograms(DQMStore::IBooker & ibooker,const edm::Run& run, const edm::EventSetup& es) override; + void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, const edm::EventSetup& es) override; void beginJob() override; void endJob() override; //xt std::pair projectHit( const PSimHit& hit, const StripGeomDetUnit* stripDet,const BoundPlane& plane); - std::pair projectHit( const PSimHit& hit, const PixelGeomDetUnit* pixelDet,const BoundPlane& plane); - - private: + std::pair projectHit(const PSimHit& hit, + const PixelGeomDetUnit* pixelDet, + const BoundPlane& plane); +private: TrackerHitAssociator::Config trackerHitAssociatorConfig_; //TrackLocalAngle *anglefinder_; DQMStore* dbe_; @@ -95,11 +94,11 @@ class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer edm::EDGetTokenT recoTrackCollectionToken_; bool MTCCtrack_; - bool checkType_; // do we check that the simHit associated with recHit is of the expected particle type ? - int genType_; // the type of particle that the simHit associated with recHits should be + bool checkType_; // do we check that the simHit associated with recHit is of the expected particle type ? + int genType_; // the type of particle that the simHit associated with recHits should be // Pixel barrel detector has 3 layers and 8 modules; book histograms for each module = (layer, ring) pair - + MonitorElement* mePosxBarrelLayerModule[3][8]; MonitorElement* mePosyBarrelLayerModule[3][8]; MonitorElement* meErrxBarrelLayerModule[3][8]; @@ -124,7 +123,7 @@ class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer MonitorElement* mePullYvsPhiBarrelLayerModule[3][8]; MonitorElement* mePullXvsEtaBarrelLayerModule[3][8]; MonitorElement* mePullYvsEtaBarrelLayerModule[3][8]; - + // All layers and modules together MonitorElement* mePosxBarrel; MonitorElement* mePosyBarrel; @@ -195,7 +194,7 @@ class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer MonitorElement* meWPullXvsBetaBarrelNonFlippedLadders; MonitorElement* meWPullYvsBetaBarrelNonFlippedLadders; - // Split barrel x/y residuals and pulls in 3 layers + // Split barrel x/y residuals and pulls in 3 layers MonitorElement* meResxBarrelLayer[3]; MonitorElement* meResyBarrelLayer[3]; MonitorElement* mePullxBarrelLayer[3]; @@ -447,71 +446,70 @@ class SiPixelTrackingRecHitsValid : public DQMEDAnalyzer MonitorElement* meWPullXvsBetaZpPanel2; MonitorElement* meWPullYvsBetaZpPanel2; - // all hits (not only from tracks) + // all hits (not only from tracks) MonitorElement* mePosxBarrel_all_hits; MonitorElement* mePosyBarrel_all_hits; - + MonitorElement* mePosxZmPanel1_all_hits; MonitorElement* mePosyZmPanel1_all_hits; MonitorElement* mePosxZmPanel2_all_hits; MonitorElement* mePosyZmPanel2_all_hits; - + MonitorElement* mePosxZpPanel1_all_hits; MonitorElement* mePosyZpPanel1_all_hits; MonitorElement* mePosxZpPanel2_all_hits; MonitorElement* mePosyZpPanel2_all_hits; - + // control histograms MonitorElement* meTracksPerEvent; MonitorElement* mePixRecHitsPerTrack; - // variables that go in the output tree - float rechitx; // x position of hit - float rechity; // y position of hit - float rechitz; // z position of hit - float rechiterrx; // x position error of hit (error not squared) - float rechiterry; // y position error of hit (error not squared) + float rechitx; // x position of hit + float rechity; // y position of hit + float rechitz; // z position of hit + float rechiterrx; // x position error of hit (error not squared) + float rechiterry; // y position error of hit (error not squared) - float rechitresx; // difference between reconstructed hit x position and 'true' x position - float rechitresy; // difference between reconstructed hit y position and 'true' y position - float rechitpullx; // x residual divideded by error - float rechitpully; // y residual divideded by error + float rechitresx; // difference between reconstructed hit x position and 'true' x position + float rechitresy; // difference between reconstructed hit y position and 'true' y position + float rechitpullx; // x residual divideded by error + float rechitpully; // y residual divideded by error - int npix; // number of pixel in the cluster - int nxpix; // size of cluster (number of pixels) along x direction - int nypix; // size of cluster (number of pixels) along y direction - float charge; // total charge in cluster + int npix; // number of pixel in the cluster + int nxpix; // size of cluster (number of pixels) along x direction + int nypix; // size of cluster (number of pixels) along y direction + float charge; // total charge in cluster - float alpha; // track angle in the xz plane of the module local coordinate system - float beta; // track angle in the yz plane of the module local coordinate system + float alpha; // track angle in the xz plane of the module local coordinate system + float beta; // track angle in the yz plane of the module local coordinate system - float phi; // polar track angle - float eta; // pseudo-rapidity (function of theta, the azimuthal angle) + float phi; // polar track angle + float eta; // pseudo-rapidity (function of theta, the azimuthal angle) int subdetId; - int layer; - int ladder; - int mod; - int side; - int disk; - int blade; - int panel; - int plaq; - int half; // half = 1 if the barrel module is half size and 0 if it is full size (only defined for barrel) - int flipped; // flipped = 1 if the module is flipped and 0 if non-flipped (only defined for barrel) - - int nsimhit; // number of simhits associated with a rechit - int pidhit; // PID of the particle that produced the simHit associated with the recHit - - float simhitx; // true x position of hit - float simhity; // true y position of hit + int layer; + int ladder; + int mod; + int side; + int disk; + int blade; + int panel; + int plaq; + int half; // half = 1 if the barrel module is half size and 0 if it is full size (only defined for barrel) + int flipped; // flipped = 1 if the module is flipped and 0 if non-flipped (only defined for barrel) + + int nsimhit; // number of simhits associated with a rechit + int pidhit; // PID of the particle that produced the simHit associated with the recHit + + float simhitx; // true x position of hit + float simhity; // true y position of hit edm::EventNumber_t evt; edm::RunNumber_t run; - TFile * tfile_; - TTree * t_; + TFile* tfile_; + TTree* t_; }; #endif diff --git a/Validation/RecoTrack/interface/SiStripTrackingRecHitsValid.h b/Validation/RecoTrack/interface/SiStripTrackingRecHitsValid.h index 6bd61ed5ba82c..29a6c6e6f312d 100644 --- a/Validation/RecoTrack/interface/SiStripTrackingRecHitsValid.h +++ b/Validation/RecoTrack/interface/SiStripTrackingRecHitsValid.h @@ -32,7 +32,7 @@ #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h" #include "TrackingTools/TrackFitters/interface/KFTrajectoryFitter.h" #include "TrackingTools/TrackFitters/interface/KFTrajectorySmoother.h" -#include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h" +#include "RecoTracker/TransientTrackingRecHit/interface/TkTransientTrackingRecHitBuilder.h" #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -49,13 +49,13 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" //--- for SimHit association -#include "SimDataFormats/TrackingHit/interface/PSimHit.h" -#include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" +#include "SimDataFormats/TrackingHit/interface/PSimHit.h" +#include "SimTracker/TrackerHitAssociation/interface/TrackerHitAssociator.h" #include "Geometry/CommonTopologies/interface/PixelTopology.h" #include "Geometry/CommonTopologies/interface/StripTopology.h" #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h" -#include "Geometry/CommonDetUnit/interface/GeomDetType.h" -#include "Geometry/CommonDetUnit/interface/GeomDet.h" +#include "Geometry/CommonDetUnit/interface/GeomDetType.h" +#include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonDetUnit/interface/GluedGeomDet.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" @@ -72,18 +72,16 @@ class SiStripDetCabling; class SiStripDCSStatus; -class SiStripTrackingRecHitsValid : public DQMEDAnalyzer -{ - public: - +class SiStripTrackingRecHitsValid : public DQMEDAnalyzer { +public: SiStripTrackingRecHitsValid(const edm::ParameterSet& conf); - + ~SiStripTrackingRecHitsValid() override; // ALL - //Simple hits MEs either from matched either + //Simple hits MEs either from matched either //from hit1D, hit2D in all subdetectors. - struct SimpleHitsMEs{ + struct SimpleHitsMEs { MonitorElement* meCategory; MonitorElement* meTrackwidth; MonitorElement* meExpectedwidth; @@ -116,10 +114,9 @@ class SiStripTrackingRecHitsValid : public DQMEDAnalyzer MonitorElement* meResolxMF; MonitorElement* meResMF; MonitorElement* mePullMF; - }; - struct LayerMEs{ // MEs for Layer Level + struct LayerMEs { // MEs for Layer Level MonitorElement* meWclusRphi; MonitorElement* meAdcRphi; MonitorElement* meResolxLFRphi; @@ -179,12 +176,10 @@ class SiStripTrackingRecHitsValid : public DQMEDAnalyzer MonitorElement* merapidityResProfilewclus2; MonitorElement* merapidityResProfilewclus3; MonitorElement* merapidityResProfilewclus4; - - }; - struct StereoAndMatchedMEs{ // MEs for stereo and matched hits - + struct StereoAndMatchedMEs { // MEs for stereo and matched hits + MonitorElement* meWclusSas; MonitorElement* meAdcSas; MonitorElement* meResolxLFSas; @@ -221,52 +216,48 @@ class SiStripTrackingRecHitsValid : public DQMEDAnalyzer MonitorElement* meResyMatched; MonitorElement* mePullxMatched; MonitorElement* mePullyMatched; - }; - struct RecHitProperties{ + struct RecHitProperties { float x; float y; float z; - float resolxx; - float resolxy; - float resolyy; - float resolxxMF; // in Measurement Frame -// float phi; + float resolxx; + float resolxy; + float resolyy; + float resolxxMF; // in Measurement Frame + // float phi; float resx; float resy; - float resxMF;// in Measurement Frame + float resxMF; // in Measurement Frame float pullx; float pully; - float pullxMF;// in Measurement Frame + float pullxMF; // in Measurement Frame float trackangle; float trackanglebeta; -// float trackangle2; + // float trackangle2; float trackwidth; - int expectedwidth; - int category; - float thickness; - int clusiz; + int expectedwidth; + int category; + float thickness; + int clusiz; float cluchg; }; - protected: - +protected: void analyze(const edm::Event& e, const edm::EventSetup& c) override; - void bookHistograms(DQMStore::IBooker & ibooker,const edm::Run& run, const edm::EventSetup& es) override; - const MagneticField * magfield2_ ; + void bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, const edm::EventSetup& es) override; + const MagneticField* magfield2_; void endJob() override; - private: - +private: DQMStore* dbe_; bool runStandalone; bool outputMEsInRootFile; std::string outputFileName; - + std::string topFolderName_; - - + bool layerswitchResolx_LF; bool layerswitchResolx_MF; bool layerswitchRes_LF; @@ -301,10 +292,10 @@ class SiStripTrackingRecHitsValid : public DQMEDAnalyzer bool layerswitchAdcRphi; bool layerswitchResolxLFRphi; bool layerswitchResolxMFRphi; - bool layerswitchResolxMFRphiwclus1 ; - bool layerswitchResolxMFRphiwclus2 ; - bool layerswitchResolxMFRphiwclus3 ; - bool layerswitchResolxMFRphiwclus4 ; + bool layerswitchResolxMFRphiwclus1; + bool layerswitchResolxMFRphiwclus2; + bool layerswitchResolxMFRphiwclus3; + bool layerswitchResolxMFRphiwclus4; bool layerswitchResLFRphi; bool layerswitchResMFRphi; bool layerswitchResMFRphiwclus1; @@ -394,30 +385,49 @@ class SiStripTrackingRecHitsValid : public DQMEDAnalyzer std::vector matched; std::map LayerMEsMap; std::map StereoAndMatchedMEsMap; - std::map > LayerDetMap; - std::map > StereoAndMatchedDetMap; + std::map > LayerDetMap; + std::map > StereoAndMatchedDetMap; edm::ESHandle SiStripDetCabling_; - std::pair projectHit( const PSimHit& hit, const StripGeomDetUnit* stripDet,const BoundPlane& plane); - - LocalVector driftDirection(const StripGeomDetUnit* det)const; - - MonitorElement* Fit_SliceY(TH2F * Histo2D); - - void createMEs(DQMStore::IBooker & ibooker,const edm::EventSetup& es); - void createSimpleHitsMEs(DQMStore::IBooker & ibooker); - void createLayerMEs(DQMStore::IBooker & ibooker,std::string label); - void createStereoAndMatchedMEs(DQMStore::IBooker & ibooker,std::string label); - - MonitorElement* bookME1D(DQMStore::IBooker & ibooker,const char* ParameterSetLabel, const char* HistoName, const char* HistoTitle); - MonitorElement* bookMEProfile(DQMStore::IBooker & ibooker,const char* ParameterSetLabel, const char* HistoName, const char* HistoTitle); - - inline void fillME(MonitorElement* ME,float value1){if (ME!=nullptr)ME->Fill(value1);} - inline void fillME(MonitorElement* ME,float value1,float value2){if (ME!=nullptr)ME->Fill(value1,value2);} - inline void fillME(MonitorElement* ME,float value1,float value2,float value3){if (ME!=nullptr)ME->Fill(value1,value2,value3);} - inline void fillME(MonitorElement* ME,float value1,float value2,float value3,float value4){if (ME!=nullptr)ME->Fill(value1,value2,value3,value4);} - + std::pair projectHit(const PSimHit& hit, + const StripGeomDetUnit* stripDet, + const BoundPlane& plane); + + LocalVector driftDirection(const StripGeomDetUnit* det) const; + + MonitorElement* Fit_SliceY(TH2F* Histo2D); + + void createMEs(DQMStore::IBooker& ibooker, const edm::EventSetup& es); + void createSimpleHitsMEs(DQMStore::IBooker& ibooker); + void createLayerMEs(DQMStore::IBooker& ibooker, std::string label); + void createStereoAndMatchedMEs(DQMStore::IBooker& ibooker, std::string label); + + MonitorElement* bookME1D(DQMStore::IBooker& ibooker, + const char* ParameterSetLabel, + const char* HistoName, + const char* HistoTitle); + MonitorElement* bookMEProfile(DQMStore::IBooker& ibooker, + const char* ParameterSetLabel, + const char* HistoName, + const char* HistoTitle); + + inline void fillME(MonitorElement* ME, float value1) { + if (ME != nullptr) + ME->Fill(value1); + } + inline void fillME(MonitorElement* ME, float value1, float value2) { + if (ME != nullptr) + ME->Fill(value1, value2); + } + inline void fillME(MonitorElement* ME, float value1, float value2, float value3) { + if (ME != nullptr) + ME->Fill(value1, value2, value3); + } + inline void fillME(MonitorElement* ME, float value1, float value2, float value3, float value4) { + if (ME != nullptr) + ME->Fill(value1, value2, value3, value4); + } edm::ParameterSet conf_; TrackerHitAssociator::Config trackerHitAssociatorConfig_; @@ -426,16 +436,23 @@ class SiStripTrackingRecHitsValid : public DQMEDAnalyzer RecHitProperties rechitpro; - void rechitanalysis(LocalVector ldir, const TrackingRecHit *rechit, const StripGeomDetUnit *stripdet, edm::ESHandle < StripClusterParameterEstimator > stripcpe, TrackerHitAssociator& associate, bool simplehit1or2D); - - enum class MatchStatus { matched, monoHit, stereoHit}; - void rechitanalysis_matched(LocalVector ldir, const TrackingRecHit *rechit, const GluedGeomDet* gluedDet,TrackerHitAssociator& associate, edm::ESHandle < StripClusterParameterEstimator > stripcpe, const MatchStatus matchedmonorstereo); - + void rechitanalysis(LocalVector ldir, + const TrackingRecHit* rechit, + const StripGeomDetUnit* stripdet, + edm::ESHandle stripcpe, + TrackerHitAssociator& associate, + bool simplehit1or2D); + + enum class MatchStatus { matched, monoHit, stereoHit }; + void rechitanalysis_matched(LocalVector ldir, + const TrackingRecHit* rechit, + const GluedGeomDet* gluedDet, + TrackerHitAssociator& associate, + edm::ESHandle stripcpe, + const MatchStatus matchedmonorstereo); float track_rapidity; edm::EDGetTokenT > tracksInputToken_; - }; - #endif diff --git a/Validation/RecoTrack/plugins/CrossingFramePSimHitToPSimHits.cc b/Validation/RecoTrack/plugins/CrossingFramePSimHitToPSimHits.cc index 80132b7eb4c5c..9dc6e1571ec56 100644 --- a/Validation/RecoTrack/plugins/CrossingFramePSimHitToPSimHits.cc +++ b/Validation/RecoTrack/plugins/CrossingFramePSimHitToPSimHits.cc @@ -8,7 +8,7 @@ #include "SimDataFormats/TrackingHit/interface/PSimHit.h" #include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h" -class CrossingFramePSimHitToPSimHitsConverter: public edm::global::EDProducer<> { +class CrossingFramePSimHitToPSimHitsConverter : public edm::global::EDProducer<> { public: CrossingFramePSimHitToPSimHitsConverter(const edm::ParameterSet& iConfig); @@ -18,8 +18,8 @@ class CrossingFramePSimHitToPSimHitsConverter: public edm::global::EDProducer<> private: struct InputInfo { - using Token = edm::EDGetTokenT >; - InputInfo(Token t, const std::string& i): token(t), instance(i) {} + using Token = edm::EDGetTokenT>; + InputInfo(Token t, const std::string& i) : token(t), instance(i) {} Token token; std::string instance; }; @@ -28,23 +28,25 @@ class CrossingFramePSimHitToPSimHitsConverter: public edm::global::EDProducer<> }; CrossingFramePSimHitToPSimHitsConverter::CrossingFramePSimHitToPSimHitsConverter(const edm::ParameterSet& iConfig) { - auto src = iConfig.getParameter >("src"); + auto src = iConfig.getParameter>("src"); input_.reserve(src.size()); - for(const auto& tag: src) { - input_.emplace_back(consumes >(tag), tag.instance()); - produces >(input_.back().instance); + for (const auto& tag : src) { + input_.emplace_back(consumes>(tag), tag.instance()); + produces>(input_.back().instance); } } void CrossingFramePSimHitToPSimHitsConverter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; - desc.add >("src", std::vector()); + desc.add>("src", std::vector()); descriptions.add("crossingFramePSimHitToPSimHits", desc); } -void CrossingFramePSimHitToPSimHitsConverter::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { - for(const auto& input: input_) { - edm::Handle > hframe; +void CrossingFramePSimHitToPSimHitsConverter::produce(edm::StreamID, + edm::Event& iEvent, + const edm::EventSetup& iSetup) const { + for (const auto& input : input_) { + edm::Handle> hframe; iEvent.getByToken(input.token, hframe); const auto& frame = *hframe; const auto& signalHits = frame.getSignal(); @@ -52,9 +54,9 @@ void CrossingFramePSimHitToPSimHitsConverter::produce(edm::StreamID, edm::Event& auto output = std::make_unique>(); output->reserve(signalHits.size() + pileupHits.size()); - for(const auto& ptr: signalHits) + for (const auto& ptr : signalHits) output->emplace_back(*ptr); - for(const auto& ptr: pileupHits) + for (const auto& ptr : pileupHits) output->emplace_back(*ptr); iEvent.put(std::move(output), input.instance); } diff --git a/Validation/RecoTrack/plugins/MultiTrackValidator.cc b/Validation/RecoTrack/plugins/MultiTrackValidator.cc index bc2342f35f602..44fe746474ae1 100644 --- a/Validation/RecoTrack/plugins/MultiTrackValidator.cc +++ b/Validation/RecoTrack/plugins/MultiTrackValidator.cc @@ -29,8 +29,7 @@ #include "DataFormats/Common/interface/Ref.h" #include "CommonTools/Utils/interface/associationMapFilterValues.h" #include "FWCore/Utilities/interface/IndexSet.h" -#include - +#include #include "TMath.h" #include @@ -41,76 +40,73 @@ using namespace std; using namespace edm; -typedef edm::Ref GenParticleRef; +typedef edm::Ref GenParticleRef; namespace { - bool trackSelected(unsigned char mask, unsigned char qual) { - return mask & 1< >("associators")), - label(pset.getParameter< std::vector >("label")), - parametersDefiner(pset.getParameter("parametersDefiner")), - parametersDefinerIsCosmic_(parametersDefiner == "CosmicParametersDefinerForTP"), - ignoremissingtkcollection_(pset.getUntrackedParameter("ignoremissingtrackcollection",false)), - useAssociators_(pset.getParameter< bool >("UseAssociators")), - calculateDrSingleCollection_(pset.getUntrackedParameter("calculateDrSingleCollection")), - doPlotsOnlyForTruePV_(pset.getUntrackedParameter("doPlotsOnlyForTruePV")), - doSummaryPlots_(pset.getUntrackedParameter("doSummaryPlots")), - doSimPlots_(pset.getUntrackedParameter("doSimPlots")), - doSimTrackPlots_(pset.getUntrackedParameter("doSimTrackPlots")), - doRecoTrackPlots_(pset.getUntrackedParameter("doRecoTrackPlots")), - dodEdxPlots_(pset.getUntrackedParameter("dodEdxPlots")), - doPVAssociationPlots_(pset.getUntrackedParameter("doPVAssociationPlots")), - doSeedPlots_(pset.getUntrackedParameter("doSeedPlots")), - doMVAPlots_(pset.getUntrackedParameter("doMVAPlots")), - simPVMaxZ_(pset.getUntrackedParameter("simPVMaxZ")) -{ - if(not (pset.getParameter("cores").label().empty())){ - cores_ = consumes >(pset.getParameter("cores")); + bool trackSelected(unsigned char mask, unsigned char qual) { return mask & 1 << qual; } + +} // namespace + +MultiTrackValidator::MultiTrackValidator(const edm::ParameterSet& pset) + : associators(pset.getUntrackedParameter>("associators")), + label(pset.getParameter>("label")), + parametersDefiner(pset.getParameter("parametersDefiner")), + parametersDefinerIsCosmic_(parametersDefiner == "CosmicParametersDefinerForTP"), + ignoremissingtkcollection_(pset.getUntrackedParameter("ignoremissingtrackcollection", false)), + useAssociators_(pset.getParameter("UseAssociators")), + calculateDrSingleCollection_(pset.getUntrackedParameter("calculateDrSingleCollection")), + doPlotsOnlyForTruePV_(pset.getUntrackedParameter("doPlotsOnlyForTruePV")), + doSummaryPlots_(pset.getUntrackedParameter("doSummaryPlots")), + doSimPlots_(pset.getUntrackedParameter("doSimPlots")), + doSimTrackPlots_(pset.getUntrackedParameter("doSimTrackPlots")), + doRecoTrackPlots_(pset.getUntrackedParameter("doRecoTrackPlots")), + dodEdxPlots_(pset.getUntrackedParameter("dodEdxPlots")), + doPVAssociationPlots_(pset.getUntrackedParameter("doPVAssociationPlots")), + doSeedPlots_(pset.getUntrackedParameter("doSeedPlots")), + doMVAPlots_(pset.getUntrackedParameter("doMVAPlots")), + simPVMaxZ_(pset.getUntrackedParameter("simPVMaxZ")) { + if (not(pset.getParameter("cores").label().empty())) { + cores_ = consumes>(pset.getParameter("cores")); } - if(label.empty()) { + if (label.empty()) { // Disable prefetching of everything if there are no track collections return; - } - const edm::InputTag& label_tp_effic_tag = pset.getParameter< edm::InputTag >("label_tp_effic"); - const edm::InputTag& label_tp_fake_tag = pset.getParameter< edm::InputTag >("label_tp_fake"); + const edm::InputTag& label_tp_effic_tag = pset.getParameter("label_tp_effic"); + const edm::InputTag& label_tp_fake_tag = pset.getParameter("label_tp_fake"); - if(pset.getParameter("label_tp_effic_refvector")) { + if (pset.getParameter("label_tp_effic_refvector")) { label_tp_effic_refvector = consumes(label_tp_effic_tag); - } - else { + } else { label_tp_effic = consumes(label_tp_effic_tag); } - if(pset.getParameter("label_tp_fake_refvector")) { + if (pset.getParameter("label_tp_fake_refvector")) { label_tp_fake_refvector = consumes(label_tp_fake_tag); - } - else { + } else { label_tp_fake = consumes(label_tp_fake_tag); } - label_pileupinfo = consumes >(pset.getParameter< edm::InputTag >("label_pileupinfo")); - for(const auto& tag: pset.getParameter>("sim")) { + label_pileupinfo = consumes>(pset.getParameter("label_pileupinfo")); + for (const auto& tag : pset.getParameter>("sim")) { simHitTokens_.push_back(consumes>(tag)); } - std::vector doResolutionPlotsForLabels = pset.getParameter >("doResolutionPlotsForLabels"); + std::vector doResolutionPlotsForLabels = + pset.getParameter>("doResolutionPlotsForLabels"); doResolutionPlots_.reserve(label.size()); for (auto& itag : label) { - labelToken.push_back(consumes >(itag)); - const bool doResol = doResolutionPlotsForLabels.empty() || (std::find(cbegin(doResolutionPlotsForLabels), cend(doResolutionPlotsForLabels), itag) != cend(doResolutionPlotsForLabels)); + labelToken.push_back(consumes>(itag)); + const bool doResol = doResolutionPlotsForLabels.empty() || + (std::find(cbegin(doResolutionPlotsForLabels), cend(doResolutionPlotsForLabels), itag) != + cend(doResolutionPlotsForLabels)); doResolutionPlots_.push_back(doResol); } - { // check for duplicates + { // check for duplicates auto labelTmp = edm::vector_transform(label, [&](const edm::InputTag& tag) { return tag.label(); }); std::sort(begin(labelTmp), end(labelTmp)); std::string empty; const std::string* prev = ∅ - for(const std::string& l: labelTmp) { - if(l == *prev) { + for (const std::string& l : labelTmp) { + if (l == *prev) { throw cms::Exception("Configuration") << "Duplicate InputTag in labels: " << l; } prev = &l; @@ -125,120 +121,125 @@ MultiTrackValidator::MultiTrackValidator(const edm::ParameterSet& pset): dirName_ = pset.getParameter("dirName"); - tpNLayersToken_ = consumes >(pset.getParameter("label_tp_nlayers")); - tpNPixelLayersToken_ = consumes >(pset.getParameter("label_tp_npixellayers")); - tpNStripStereoLayersToken_ = consumes >(pset.getParameter("label_tp_nstripstereolayers")); + tpNLayersToken_ = consumes>(pset.getParameter("label_tp_nlayers")); + tpNPixelLayersToken_ = + consumes>(pset.getParameter("label_tp_npixellayers")); + tpNStripStereoLayersToken_ = + consumes>(pset.getParameter("label_tp_nstripstereolayers")); - if(dodEdxPlots_) { - m_dEdx1Tag = consumes >(pset.getParameter< edm::InputTag >("dEdx1Tag")); - m_dEdx2Tag = consumes >(pset.getParameter< edm::InputTag >("dEdx2Tag")); + if (dodEdxPlots_) { + m_dEdx1Tag = consumes>(pset.getParameter("dEdx1Tag")); + m_dEdx2Tag = consumes>(pset.getParameter("dEdx2Tag")); } - label_tv = consumes(pset.getParameter< edm::InputTag >("label_tv")); - if(doPlotsOnlyForTruePV_ || doPVAssociationPlots_) { - recoVertexToken_ = consumes >(pset.getUntrackedParameter("label_vertex")); - vertexAssociatorToken_ = consumes(pset.getUntrackedParameter("vertexAssociator")); + label_tv = consumes(pset.getParameter("label_tv")); + if (doPlotsOnlyForTruePV_ || doPVAssociationPlots_) { + recoVertexToken_ = consumes>(pset.getUntrackedParameter("label_vertex")); + vertexAssociatorToken_ = + consumes(pset.getUntrackedParameter("vertexAssociator")); } - if(doMVAPlots_) { + if (doMVAPlots_) { mvaQualityCollectionTokens_.resize(labelToken.size()); auto mvaPSet = pset.getUntrackedParameter("mvaLabels"); - for(size_t iIter=0; iIter >(labels.module), - [&](const std::string& tag) { - return std::make_tuple(consumes(edm::InputTag(tag, "MVAValues")), - consumes(edm::InputTag(tag, "QualityMasks"))); - }); + if (mvaPSet.exists(labels.module)) { + mvaQualityCollectionTokens_[iIter] = edm::vector_transform( + mvaPSet.getUntrackedParameter>(labels.module), [&](const std::string& tag) { + return std::make_tuple(consumes(edm::InputTag(tag, "MVAValues")), + consumes(edm::InputTag(tag, "QualityMasks"))); + }); } } } tpSelector = TrackingParticleSelector(pset.getParameter("ptMinTP"), pset.getParameter("ptMaxTP"), - pset.getParameter("minRapidityTP"), - pset.getParameter("maxRapidityTP"), - pset.getParameter("tipTP"), - pset.getParameter("lipTP"), - pset.getParameter("minHitTP"), - pset.getParameter("signalOnlyTP"), - pset.getParameter("intimeOnlyTP"), - pset.getParameter("chargedOnlyTP"), - pset.getParameter("stableOnlyTP"), - pset.getParameter >("pdgIdTP")); + pset.getParameter("minRapidityTP"), + pset.getParameter("maxRapidityTP"), + pset.getParameter("tipTP"), + pset.getParameter("lipTP"), + pset.getParameter("minHitTP"), + pset.getParameter("signalOnlyTP"), + pset.getParameter("intimeOnlyTP"), + pset.getParameter("chargedOnlyTP"), + pset.getParameter("stableOnlyTP"), + pset.getParameter>("pdgIdTP")); cosmictpSelector = CosmicTrackingParticleSelector(pset.getParameter("ptMinTP"), - pset.getParameter("minRapidityTP"), - pset.getParameter("maxRapidityTP"), - pset.getParameter("tipTP"), - pset.getParameter("lipTP"), - pset.getParameter("minHitTP"), - pset.getParameter("chargedOnlyTP"), - pset.getParameter >("pdgIdTP")); - + pset.getParameter("minRapidityTP"), + pset.getParameter("maxRapidityTP"), + pset.getParameter("tipTP"), + pset.getParameter("lipTP"), + pset.getParameter("minHitTP"), + pset.getParameter("chargedOnlyTP"), + pset.getParameter>("pdgIdTP")); ParameterSet psetVsPhi = psetForHistoProducerAlgo.getParameter("TpSelectorForEfficiencyVsPhi"); dRtpSelector = TrackingParticleSelector(psetVsPhi.getParameter("ptMin"), psetVsPhi.getParameter("ptMax"), - psetVsPhi.getParameter("minRapidity"), - psetVsPhi.getParameter("maxRapidity"), - psetVsPhi.getParameter("tip"), - psetVsPhi.getParameter("lip"), - psetVsPhi.getParameter("minHit"), - psetVsPhi.getParameter("signalOnly"), - psetVsPhi.getParameter("intimeOnly"), - psetVsPhi.getParameter("chargedOnly"), - psetVsPhi.getParameter("stableOnly"), - psetVsPhi.getParameter >("pdgId")); + psetVsPhi.getParameter("minRapidity"), + psetVsPhi.getParameter("maxRapidity"), + psetVsPhi.getParameter("tip"), + psetVsPhi.getParameter("lip"), + psetVsPhi.getParameter("minHit"), + psetVsPhi.getParameter("signalOnly"), + psetVsPhi.getParameter("intimeOnly"), + psetVsPhi.getParameter("chargedOnly"), + psetVsPhi.getParameter("stableOnly"), + psetVsPhi.getParameter>("pdgId")); dRTrackSelector = MTVHistoProducerAlgoForTracker::makeRecoTrackSelectorFromTPSelectorParameters(psetVsPhi); useGsf = pset.getParameter("useGsf"); - _simHitTpMapTag = mayConsume(pset.getParameter("simHitTpMapTag")); + _simHitTpMapTag = mayConsume( + pset.getParameter("simHitTpMapTag")); - if(calculateDrSingleCollection_) { - labelTokenForDrCalculation = consumes >(pset.getParameter("trackCollectionForDrCalculation")); + if (calculateDrSingleCollection_) { + labelTokenForDrCalculation = + consumes>(pset.getParameter("trackCollectionForDrCalculation")); } - if(useAssociators_) { - for (auto const& src: associators) { + if (useAssociators_) { + for (auto const& src : associators) { associatorTokens.push_back(consumes(src)); } } else { - for (auto const& src: associators) { + for (auto const& src : associators) { associatormapStRs.push_back(consumes(src)); associatormapRtSs.push_back(consumes(src)); } } } - MultiTrackValidator::~MultiTrackValidator() {} - -void MultiTrackValidator::bookHistograms(DQMStore::ConcurrentBooker& ibook, edm::Run const&, edm::EventSetup const& setup, Histograms& histograms) const { - if(label.empty()) { +void MultiTrackValidator::bookHistograms(DQMStore::ConcurrentBooker& ibook, + edm::Run const&, + edm::EventSetup const& setup, + Histograms& histograms) const { + if (label.empty()) { // Disable histogram booking if there are no track collections return; } const auto minColl = -0.5; - const auto maxColl = label.size()-0.5; + const auto maxColl = label.size() - 0.5; const auto nintColl = label.size(); auto binLabels = [&](ConcurrentMonitorElement me) { - for(size_t i=0; ibookSimTrackHistos(ibook, histograms.histoProducerAlgo, doResolutionPlots); - if(doPVAssociationPlots_) histoProducerAlgo_->bookSimTrackPVAssociationHistos(ibook, histograms.histoProducerAlgo); + if (doPVAssociationPlots_) + histoProducerAlgo_->bookSimTrackPVAssociationHistos(ibook, histograms.histoProducerAlgo); } //Booking histograms concerning with reconstructed tracks - if(doRecoTrackPlots_) { + if (doRecoTrackPlots_) { histoProducerAlgo_->bookRecoHistos(ibook, histograms.histoProducerAlgo, doResolutionPlots); - if (dodEdxPlots_) histoProducerAlgo_->bookRecodEdxHistos(ibook, histograms.histoProducerAlgo); - if (doPVAssociationPlots_) histoProducerAlgo_->bookRecoPVAssociationHistos(ibook, histograms.histoProducerAlgo); - if (doMVAPlots_) histoProducerAlgo_->bookMVAHistos(ibook, histograms.histoProducerAlgo, mvaQualityCollectionTokens_[www].size()); + if (dodEdxPlots_) + histoProducerAlgo_->bookRecodEdxHistos(ibook, histograms.histoProducerAlgo); + if (doPVAssociationPlots_) + histoProducerAlgo_->bookRecoPVAssociationHistos(ibook, histograms.histoProducerAlgo); + if (doMVAPlots_) + histoProducerAlgo_->bookMVAHistos( + ibook, histograms.histoProducerAlgo, mvaQualityCollectionTokens_[www].size()); } - if(doSeedPlots_) { + if (doSeedPlots_) { histoProducerAlgo_->bookSeedHistos(ibook, histograms.histoProducerAlgo); } - }//end loop www - }// end loop ww + } //end loop www + } // end loop ww } namespace { @@ -316,40 +344,49 @@ namespace { // as it will be 0:0 for empty. This covers also the case where // both are empty. The case of fake being empty and eff not is an // error. - if(eff.empty()) + if (eff.empty()) return; // First ensure product ids - if(eff.id() != fake.id()) { - throw cms::Exception("Configuration") << "Efficiency and fake TrackingParticle (refs) point to different collections (eff " << eff.id() << " fake " << fake.id() << "). This is not supported. Efficiency TP set must be the same or a subset of the fake TP set."; + if (eff.id() != fake.id()) { + throw cms::Exception("Configuration") + << "Efficiency and fake TrackingParticle (refs) point to different collections (eff " << eff.id() << " fake " + << fake.id() + << "). This is not supported. Efficiency TP set must be the same or a subset of the fake TP set."; } // Same technique as in associationMapFilterValues edm::IndexSet fakeKeys; fakeKeys.reserve(fake.size()); - for(const auto& ref: fake) { + for (const auto& ref : fake) { fakeKeys.insert(ref.key()); } - for(const auto& ref: eff) { - if(!fakeKeys.has(ref.key())) { - throw cms::Exception("Configuration") << "Efficiency TrackingParticle " << ref.key() << " is not found from the set of fake TPs. This is not supported. The efficiency TP set must be the same or a subset of the fake TP set."; + for (const auto& ref : eff) { + if (!fakeKeys.has(ref.key())) { + throw cms::Exception("Configuration") << "Efficiency TrackingParticle " << ref.key() + << " is not found from the set of fake TPs. This is not supported. The " + "efficiency TP set must be the same or a subset of the fake TP set."; } } } -} - -const TrackingVertex::LorentzVector *MultiTrackValidator::getSimPVPosition(const edm::Handle& htv) const { - for(const auto& simV: *htv) { - if(simV.eventId().bunchCrossing() != 0) continue; // remove OOTPU - if(simV.eventId().event() != 0) continue; // pick the PV of hard scatter +} // namespace + +const TrackingVertex::LorentzVector* MultiTrackValidator::getSimPVPosition( + const edm::Handle& htv) const { + for (const auto& simV : *htv) { + if (simV.eventId().bunchCrossing() != 0) + continue; // remove OOTPU + if (simV.eventId().event() != 0) + continue; // pick the PV of hard scatter return &(simV.position()); } return nullptr; } -const reco::Vertex::Point *MultiTrackValidator::getRecoPVPosition(const edm::Event& event, const edm::Handle& htv) const { - edm::Handle > hvertex; +const reco::Vertex::Point* MultiTrackValidator::getRecoPVPosition( + const edm::Event& event, const edm::Handle& htv) const { + edm::Handle> hvertex; event.getByToken(recoVertexToken_, hvertex); edm::Handle hvassociator; @@ -357,16 +394,16 @@ const reco::Vertex::Point *MultiTrackValidator::getRecoPVPosition(const edm::Eve auto v_r2s = hvassociator->associateRecoToSim(hvertex, htv); auto pvPtr = hvertex->refAt(0); - if(pvPtr->isFake() || pvPtr->ndof() < 0) // skip junk vertices + if (pvPtr->isFake() || pvPtr->ndof() < 0) // skip junk vertices return nullptr; auto pvFound = v_r2s.find(pvPtr); - if(pvFound == v_r2s.end()) + if (pvFound == v_r2s.end()) return nullptr; - for(const auto& vertexRefQuality: pvFound->val) { + for (const auto& vertexRefQuality : pvFound->val) { const TrackingVertex& tv = *(vertexRefQuality.first); - if(tv.eventId().event() == 0 && tv.eventId().bunchCrossing() == 0) { + if (tv.eventId().event() == 0 && tv.eventId().bunchCrossing() == 0) { return &(pvPtr->position()); } } @@ -374,64 +411,66 @@ const reco::Vertex::Point *MultiTrackValidator::getRecoPVPosition(const edm::Eve return nullptr; } -void MultiTrackValidator::tpParametersAndSelection(const Histograms& histograms, - const TrackingParticleRefVector& tPCeff, - const ParametersDefinerForTP& parametersDefinerTP, - const edm::Event& event, const edm::EventSetup& setup, - const reco::BeamSpot& bs, - std::vector >& momVert_tPCeff, - std::vector& selected_tPCeff) const { +void MultiTrackValidator::tpParametersAndSelection( + const Histograms& histograms, + const TrackingParticleRefVector& tPCeff, + const ParametersDefinerForTP& parametersDefinerTP, + const edm::Event& event, + const edm::EventSetup& setup, + const reco::BeamSpot& bs, + std::vector>& momVert_tPCeff, + std::vector& selected_tPCeff) const { selected_tPCeff.reserve(tPCeff.size()); momVert_tPCeff.reserve(tPCeff.size()); int nIntimeTPs = 0; - if(parametersDefinerIsCosmic_) { - for(size_t j=0; jfill_generic_simTrack_histos(histograms.histoProducerAlgo, momentum, vertex, tpr->eventId().bunchCrossing()); + TrackingParticle::Vector momentum = parametersDefinerTP.momentum(event, setup, tpr); + TrackingParticle::Point vertex = parametersDefinerTP.vertex(event, setup, tpr); + if (doSimPlots_) { + histoProducerAlgo_->fill_generic_simTrack_histos( + histograms.histoProducerAlgo, momentum, vertex, tpr->eventId().bunchCrossing()); } - if(tpr->eventId().bunchCrossing() == 0) + if (tpr->eventId().bunchCrossing() == 0) ++nIntimeTPs; - if(cosmictpSelector(tpr,&bs,event,setup)) { + if (cosmictpSelector(tpr, &bs, event, setup)) { selected_tPCeff.push_back(j); momVert_tPCeff.emplace_back(momentum, vertex); } } - } - else { - size_t j=0; - for(auto const& tpr: tPCeff) { + } else { + size_t j = 0; + for (auto const& tpr : tPCeff) { const TrackingParticle& tp = *tpr; // TODO: do we want to fill these from all TPs that include IT // and OOT (as below), or limit to IT+OOT TPs passing tpSelector // (as it was before)? The latter would require another instance // of tpSelector with intimeOnly=False. - if(doSimPlots_) { - histoProducerAlgo_->fill_generic_simTrack_histos(histograms.histoProducerAlgo, tp.momentum(), tp.vertex(), tp.eventId().bunchCrossing()); + if (doSimPlots_) { + histoProducerAlgo_->fill_generic_simTrack_histos( + histograms.histoProducerAlgo, tp.momentum(), tp.vertex(), tp.eventId().bunchCrossing()); } - if(tp.eventId().bunchCrossing() == 0) + if (tp.eventId().bunchCrossing() == 0) ++nIntimeTPs; - if(tpSelector(tp)) { + if (tpSelector(tp)) { selected_tPCeff.push_back(j); - TrackingParticle::Vector momentum = parametersDefinerTP.momentum(event,setup,tpr); - TrackingParticle::Point vertex = parametersDefinerTP.vertex(event,setup,tpr); + TrackingParticle::Vector momentum = parametersDefinerTP.momentum(event, setup, tpr); + TrackingParticle::Point vertex = parametersDefinerTP.vertex(event, setup, tpr); momVert_tPCeff.emplace_back(momentum, vertex); } ++j; } } - if(doSimPlots_) { + if (doSimPlots_) { histoProducerAlgo_->fill_simTrackBased_histos(histograms.histoProducerAlgo, nIntimeTPs); } } - size_t MultiTrackValidator::tpDR(const TrackingParticleRefVector& tPCeff, const std::vector& selected_tPCeff, DynArray& dR_tPCeff, @@ -439,34 +478,38 @@ size_t MultiTrackValidator::tpDR(const TrackingParticleRefVector& tPCeff, const edm::View* cores) const { float etaL[tPCeff.size()], phiL[tPCeff.size()]; size_t n_selTP_dr = 0; - for(size_t iTP: selected_tPCeff) { + for (size_t iTP : selected_tPCeff) { //calculare dR wrt inclusive collection (also with PU, low pT, displaced) auto const& tp2 = *(tPCeff[iTP]); - auto && p = tp2.momentum(); - etaL[iTP] = etaFromXYZ(p.x(),p.y(),p.z()); - phiL[iTP] = atan2f(p.y(),p.x()); + auto&& p = tp2.momentum(); + etaL[iTP] = etaFromXYZ(p.x(), p.y(), p.z()); + phiL[iTP] = atan2f(p.y(), p.x()); } - for(size_t iTP1: selected_tPCeff) { + for (size_t iTP1 : selected_tPCeff) { auto const& tp = *(tPCeff[iTP1]); double dR = std::numeric_limits::max(); double dR_jet = std::numeric_limits::max(); - if(dRtpSelector(tp)) {//only for those needed for efficiency! + if (dRtpSelector(tp)) { //only for those needed for efficiency! ++n_selTP_dr; float eta = etaL[iTP1]; float phi = phiL[iTP1]; - for(size_t iTP2: selected_tPCeff) { + for (size_t iTP2 : selected_tPCeff) { //calculare dR wrt inclusive collection (also with PU, low pT, displaced) - if (iTP1==iTP2) {continue;} + if (iTP1 == iTP2) { + continue; + } auto dR_tmp = reco::deltaR2(eta, phi, etaL[iTP2], phiL[iTP2]); - if (dR_tmpsize(); ji++) {//jet loop - const reco::Candidate& jet = (*cores)[ji]; - double jet_eta = jet.eta(); - double jet_phi = jet.phi(); - auto dR_jet_tmp = reco::deltaR2(eta, phi, jet_eta, jet_phi); - if (dR_jet_tmpsize(); ji++) { //jet loop + const reco::Candidate& jet = (*cores)[ji]; + double jet_eta = jet.eta(); + double jet_phi = jet.phi(); + auto dR_jet_tmp = reco::deltaR2(eta, phi, jet_eta, jet_phi); + if (dR_jet_tmp < dR_jet) + dR_jet = dR_jet_tmp; } } } @@ -482,63 +525,67 @@ void MultiTrackValidator::trackDR(const edm::View& trackCollection, DynArray& dR_trk, DynArray& dR_trk_jet, const edm::View* cores) const { - int i=0; + int i = 0; float etaL[trackCollectionDr.size()]; float phiL[trackCollectionDr.size()]; bool validL[trackCollectionDr.size()]; - for (auto const & track2 : trackCollectionDr) { - auto && p = track2.momentum(); - etaL[i] = etaFromXYZ(p.x(),p.y(),p.z()); - phiL[i] = atan2f(p.y(),p.x()); + for (auto const& track2 : trackCollectionDr) { + auto&& p = track2.momentum(); + etaL[i] = etaFromXYZ(p.x(), p.y(), p.z()); + phiL[i] = atan2f(p.y(), p.x()); validL[i] = !trackFromSeedFitFailed(track2); ++i; } - for(View::size_type i=0; i::size_type i = 0; i < trackCollection.size(); ++i) { + auto const& track = trackCollection[i]; auto dR = std::numeric_limits::max(); auto dR_jet = std::numeric_limits::max(); - if(!trackFromSeedFitFailed(track)) { - auto && p = track.momentum(); - float eta = etaFromXYZ(p.x(),p.y(),p.z()); - float phi = atan2f(p.y(),p.x()); - for(View::size_type j=0; j::size_type j = 0; j < trackCollectionDr.size(); ++j) { + if (!validL[j]) + continue; auto dR_tmp = reco::deltaR2(eta, phi, etaL[j], phiL[j]); - if ( (dR_tmpstd::numeric_limits::min())) dR=dR_tmp; + if ((dR_tmp < dR) & (dR_tmp > std::numeric_limits::min())) + dR = dR_tmp; } - if(cores != nullptr){ - for (unsigned int ji = 0; ji < cores->size(); ji++) {//jet loop - const reco::Candidate& jet = (*cores)[ji]; - double jet_eta = jet.eta(); - double jet_phi = jet.phi(); - auto dR_jet_tmp = reco::deltaR2(eta, phi, jet_eta, jet_phi); - if (dR_jet_tmpsize(); ji++) { //jet loop + const reco::Candidate& jet = (*cores)[ji]; + double jet_eta = jet.eta(); + double jet_phi = jet.phi(); + auto dR_jet_tmp = reco::deltaR2(eta, phi, jet_eta, jet_phi); + if (dR_jet_tmp < dR_jet) + dR_jet = dR_jet_tmp; } } - } dR_trk[i] = std::sqrt(dR); dR_trk_jet[i] = std::sqrt(dR_jet); - } } - -void MultiTrackValidator::dqmAnalyze(const edm::Event& event, const edm::EventSetup& setup, const Histograms& histograms) const { - if(label.empty()) { +void MultiTrackValidator::dqmAnalyze(const edm::Event& event, + const edm::EventSetup& setup, + const Histograms& histograms) const { + if (label.empty()) { // Disable if there are no track collections return; } using namespace reco; - LogDebug("TrackValidator") << "\n====================================================" << "\n" - << "Analyzing new event" << "\n" - << "====================================================\n" << "\n"; - + LogDebug("TrackValidator") << "\n====================================================" + << "\n" + << "Analyzing new event" + << "\n" + << "====================================================\n" + << "\n"; edm::ESHandle parametersDefinerTPHandle; - setup.get().get(parametersDefiner,parametersDefinerTPHandle); + setup.get().get(parametersDefiner, parametersDefinerTPHandle); //Since we modify the object, we must clone it auto parametersDefinerTP = parametersDefinerTPHandle->clone(); @@ -551,47 +598,45 @@ void MultiTrackValidator::dqmAnalyze(const edm::Event& event, const edm::EventSe // consequences on the associator/association interfaces etc. TrackingParticleRefVector tmpTPeff; TrackingParticleRefVector tmpTPfake; - const TrackingParticleRefVector *tmpTPeffPtr = nullptr; - const TrackingParticleRefVector *tmpTPfakePtr = nullptr; + const TrackingParticleRefVector* tmpTPeffPtr = nullptr; + const TrackingParticleRefVector* tmpTPfakePtr = nullptr; - edm::Handle TPCollectionHeff; - edm::Handle TPCollectionHeffRefVector; + edm::Handle TPCollectionHeff; + edm::Handle TPCollectionHeffRefVector; const bool tp_effic_refvector = label_tp_effic.isUninitialized(); - if(!tp_effic_refvector) { + if (!tp_effic_refvector) { event.getByToken(label_tp_effic, TPCollectionHeff); - for(size_t i=0, size=TPCollectionHeff->size(); isize(); i < size; ++i) { tmpTPeff.push_back(TrackingParticleRef(TPCollectionHeff, i)); } tmpTPeffPtr = &tmpTPeff; - } - else { + } else { event.getByToken(label_tp_effic_refvector, TPCollectionHeffRefVector); tmpTPeffPtr = TPCollectionHeffRefVector.product(); } - if(!label_tp_fake.isUninitialized()) { - edm::Handle TPCollectionHfake ; - event.getByToken(label_tp_fake,TPCollectionHfake); - for(size_t i=0, size=TPCollectionHfake->size(); i TPCollectionHfake; + event.getByToken(label_tp_fake, TPCollectionHfake); + for (size_t i = 0, size = TPCollectionHfake->size(); i < size; ++i) { tmpTPfake.push_back(TrackingParticleRef(TPCollectionHfake, i)); } tmpTPfakePtr = &tmpTPfake; - } - else { + } else { edm::Handle TPCollectionHfakeRefVector; event.getByToken(label_tp_fake_refvector, TPCollectionHfakeRefVector); tmpTPfakePtr = TPCollectionHfakeRefVector.product(); } - TrackingParticleRefVector const & tPCeff = *tmpTPeffPtr; - TrackingParticleRefVector const & tPCfake = *tmpTPfakePtr; + TrackingParticleRefVector const& tPCeff = *tmpTPeffPtr; + TrackingParticleRefVector const& tPCfake = *tmpTPfakePtr; ensureEffIsSubsetOfFake(tPCeff, tPCfake); - if(parametersDefinerIsCosmic_) { + if (parametersDefinerIsCosmic_) { edm::Handle simHitsTPAssoc; //warning: make sure the TP collection used in the map is the same used in the MTV! - event.getByToken(_simHitTpMapTag,simHitsTPAssoc); + event.getByToken(_simHitTpMapTag, simHitsTPAssoc); parametersDefinerTP->initEvent(simHitsTPAssoc); cosmictpSelector.initEvent(simHitsTPAssoc); } @@ -599,38 +644,40 @@ void MultiTrackValidator::dqmAnalyze(const edm::Event& event, const edm::EventSe // Find the sim PV and tak its position edm::Handle htv; event.getByToken(label_tv, htv); - const TrackingVertex::LorentzVector *theSimPVPosition = getSimPVPosition(htv); - if(simPVMaxZ_ >= 0) { - if(!theSimPVPosition) return; - if(std::abs(theSimPVPosition->z()) > simPVMaxZ_) return; + const TrackingVertex::LorentzVector* theSimPVPosition = getSimPVPosition(htv); + if (simPVMaxZ_ >= 0) { + if (!theSimPVPosition) + return; + if (std::abs(theSimPVPosition->z()) > simPVMaxZ_) + return; } // Check, when necessary, if reco PV matches to sim PV - const reco::Vertex::Point *thePVposition = nullptr; - if(doPlotsOnlyForTruePV_ || doPVAssociationPlots_) { + const reco::Vertex::Point* thePVposition = nullptr; + if (doPlotsOnlyForTruePV_ || doPVAssociationPlots_) { thePVposition = getRecoPVPosition(event, htv); - if(doPlotsOnlyForTruePV_ && !thePVposition) + if (doPlotsOnlyForTruePV_ && !thePVposition) return; // Rest of the code assumes that if thePVposition is non-null, the // PV-association histograms get filled. In above, the "nullness" // is used to deliver the information if the reco PV is matched to // the sim PV. - if(!doPVAssociationPlots_) + if (!doPVAssociationPlots_) thePVposition = nullptr; } edm::Handle recoBeamSpotHandle; - event.getByToken(bsSrc,recoBeamSpotHandle); - reco::BeamSpot const & bs = *recoBeamSpotHandle; + event.getByToken(bsSrc, recoBeamSpotHandle); + reco::BeamSpot const& bs = *recoBeamSpotHandle; - edm::Handle< std::vector > puinfoH; - event.getByToken(label_pileupinfo,puinfoH); + edm::Handle> puinfoH; + event.getByToken(label_pileupinfo, puinfoH); PileupSummaryInfo puinfo; - for (unsigned int puinfo_ite=0;puinfo_ite<(*puinfoH).size();++puinfo_ite){ - if ((*puinfoH)[puinfo_ite].getBunchCrossing()==0){ - puinfo=(*puinfoH)[puinfo_ite]; + for (unsigned int puinfo_ite = 0; puinfo_ite < (*puinfoH).size(); ++puinfo_ite) { + if ((*puinfoH)[puinfo_ite].getBunchCrossing() == 0) { + puinfo = (*puinfoH)[puinfo_ite]; break; } } @@ -673,50 +720,50 @@ void MultiTrackValidator::dqmAnalyze(const edm::Event& event, const edm::EventSe //calculate dR_jet for TPs const edm::View* coresVector = nullptr; - if(not cores_.isUninitialized()){ - Handle > cores; + if (not cores_.isUninitialized()) { + Handle> cores; event.getByToken(cores_, cores); - coresVector= cores.product(); + coresVector = cores.product(); } declareDynArray(float, tPCeff.size(), dR_tPCeff_jet); size_t n_selTP_dr = tpDR(tPCeff, selected_tPCeff, dR_tPCeff, dR_tPCeff_jet, coresVector); - edm::Handle > trackCollectionForDrCalculation; - if(calculateDrSingleCollection_) { + edm::Handle> trackCollectionForDrCalculation; + if (calculateDrSingleCollection_) { event.getByToken(labelTokenForDrCalculation, trackCollectionForDrCalculation); } // dE/dx // at some point this could be generalized, with a vector of tags and a corresponding vector of Handles // I'm writing the interface such to take vectors of ValueMaps - std::vector *> v_dEdx; - if(dodEdxPlots_) { - edm::Handle > dEdx1Handle; - edm::Handle > dEdx2Handle; + std::vector*> v_dEdx; + if (dodEdxPlots_) { + edm::Handle> dEdx1Handle; + edm::Handle> dEdx2Handle; event.getByToken(m_dEdx1Tag, dEdx1Handle); event.getByToken(m_dEdx2Tag, dEdx2Handle); v_dEdx.push_back(dEdx1Handle.product()); v_dEdx.push_back(dEdx2Handle.product()); } - std::vector mvaCollections; - std::vector qualityMaskCollections; + std::vector mvaCollections; + std::vector qualityMaskCollections; std::vector mvaValues; - int w=0; //counter counting the number of sets of histograms - for (unsigned int ww=0;ww simtorecoCollectionH; + if (!useAssociators_) { + Handle simtorecoCollectionH; event.getByToken(associatormapStRs[ww], simtorecoCollectionH); simRecCollPFull = simtorecoCollectionH.product(); - Handle recotosimCollectionH; - event.getByToken(associatormapRtSs[ww],recotosimCollectionH); + Handle recotosimCollectionH; + event.getByToken(associatormapRtSs[ww], recotosimCollectionH); recSimCollP = recotosimCollectionH.product(); // We need to filter the associations of the fake-TrackingParticle @@ -726,36 +773,37 @@ void MultiTrackValidator::dqmAnalyze(const edm::Event& event, const edm::EventSe recSimCollP = &recSimCollL; } - for (unsigned int www=0;www > trackCollectionHandle; - if(!event.getByToken(labelToken[www], trackCollectionHandle)&&ignoremissingtkcollection_)continue; + edm::Handle> trackCollectionHandle; + if (!event.getByToken(labelToken[www], trackCollectionHandle) && ignoremissingtkcollection_) + continue; const edm::View& trackCollection = *trackCollectionHandle; - reco::SimToRecoCollection const * simRecCollP=nullptr; + reco::SimToRecoCollection const* simRecCollP = nullptr; reco::SimToRecoCollection simRecCollL; //associate tracks - LogTrace("TrackValidator") << "Analyzing " - << label[www] << " with " - << associators[ww] <<"\n"; - if(useAssociators_){ + LogTrace("TrackValidator") << "Analyzing " << label[www] << " with " << associators[ww] << "\n"; + if (useAssociators_) { edm::Handle theAssociator; event.getByToken(associatorTokens[ww], theAssociator); // The associator interfaces really need to be fixed... edm::RefToBaseVector trackRefs; - for(edm::View::size_type i=0; i::size_type i = 0; i < trackCollection.size(); ++i) { trackRefs.push_back(trackCollection.refAt(i)); } - - LogTrace("TrackValidator") << "Calling associateRecoToSim method" << "\n"; + LogTrace("TrackValidator") << "Calling associateRecoToSim method" + << "\n"; recSimCollL = theAssociator->associateRecoToSim(trackRefs, tPCfake); recSimCollP = &recSimCollL; - LogTrace("TrackValidator") << "Calling associateSimToReco method" << "\n"; + LogTrace("TrackValidator") << "Calling associateSimToReco method" + << "\n"; // It is necessary to do the association wrt. fake TPs, // because this SimToReco association is used also for // duplicates. Since the set of efficiency TPs are required to @@ -764,8 +812,7 @@ void MultiTrackValidator::dqmAnalyze(const edm::Event& event, const edm::EventSe // associations of TPs not in the set of efficiency TPs. simRecCollL = theAssociator->associateSimToReco(trackRefs, tPCfake); simRecCollP = &simRecCollL; - } - else{ + } else { // We need to filter the associations of the current track // collection only from SimToReco collection, otherwise the // SimToReco histograms get false entries. The filtering must @@ -774,24 +821,31 @@ void MultiTrackValidator::dqmAnalyze(const edm::Event& event, const edm::EventSe simRecCollP = &simRecCollL; } - reco::RecoToSimCollection const & recSimColl = *recSimCollP; - reco::SimToRecoCollection const & simRecColl = *simRecCollP; + reco::RecoToSimCollection const& recSimColl = *recSimCollP; + reco::SimToRecoCollection const& simRecColl = *simRecCollP; // read MVA collections - if(doMVAPlots_ && !mvaQualityCollectionTokens_[www].empty()) { + if (doMVAPlots_ && !mvaQualityCollectionTokens_[www].empty()) { edm::Handle hmva; edm::Handle hqual; - for(const auto& tokenTpl: mvaQualityCollectionTokens_[www]) { + for (const auto& tokenTpl : mvaQualityCollectionTokens_[www]) { event.getByToken(std::get<0>(tokenTpl), hmva); event.getByToken(std::get<1>(tokenTpl), hqual); mvaCollections.push_back(hmva.product()); qualityMaskCollections.push_back(hqual.product()); - if(mvaCollections.back()->size() != trackCollection.size()) { - throw cms::Exception("Configuration") << "Inconsistency in track collection and MVA sizes. Track collection " << www << " has " << trackCollection.size() << " tracks, whereas the MVA " << (mvaCollections.size()-1) << " for it has " << mvaCollections.back()->size() << " entries. Double-check your configuration."; + if (mvaCollections.back()->size() != trackCollection.size()) { + throw cms::Exception("Configuration") + << "Inconsistency in track collection and MVA sizes. Track collection " << www << " has " + << trackCollection.size() << " tracks, whereas the MVA " << (mvaCollections.size() - 1) + << " for it has " << mvaCollections.back()->size() << " entries. Double-check your configuration."; } - if(qualityMaskCollections.back()->size() != trackCollection.size()) { - throw cms::Exception("Configuration") << "Inconsistency in track collection and quality mask sizes. Track collection " << www << " has " << trackCollection.size() << " tracks, whereas the quality mask " << (qualityMaskCollections.size()-1) << " for it has " << qualityMaskCollections.back()->size() << " entries. Double-check your configuration."; + if (qualityMaskCollections.back()->size() != trackCollection.size()) { + throw cms::Exception("Configuration") + << "Inconsistency in track collection and quality mask sizes. Track collection " << www << " has " + << trackCollection.size() << " tracks, whereas the quality mask " << (qualityMaskCollections.size() - 1) + << " for it has " << qualityMaskCollections.back()->size() + << " entries. Double-check your configuration."; } } } @@ -803,256 +857,288 @@ void MultiTrackValidator::dqmAnalyze(const edm::Event& event, const edm::EventSe //compute number of tracks per eta interval // LogTrace("TrackValidator") << "\n# of TrackingParticles: " << tPCeff.size() << "\n"; - int ats(0); //This counter counts the number of simTracks that are "associated" to recoTracks - int st(0); //This counter counts the number of simulated tracks passing the MTV selection (i.e. tpSelector(tp) ) + int ats(0); //This counter counts the number of simTracks that are "associated" to recoTracks + int st(0); //This counter counts the number of simulated tracks passing the MTV selection (i.e. tpSelector(tp) ) //loop over already-selected TPs for tracking efficiency - for(size_t i=0; i(momVert); - const TrackingParticle::Point& vertex = std::get(momVert); - dxySim = TrackingParticleIP::dxy(vertex, momentum, bs.position()); - dzSim = TrackingParticleIP::dz(vertex, momentum, bs.position()); - - if(theSimPVPosition) { - dxyPVSim = TrackingParticleIP::dxy(vertex, momentum, *theSimPVPosition); - dzPVSim = TrackingParticleIP::dz(vertex, momentum, *theSimPVPosition); - } - } - //If the TrackingParticle is comics, get the momentum and vertex at PCA - else - { - momentumTP = std::get(momVert); - vertexTP = std::get(momVert); - dxySim = TrackingParticleIP::dxy(vertexTP, momentumTP, bs.position()); - dzSim = TrackingParticleIP::dz(vertexTP, momentumTP, bs.position()); - - // Do dxy and dz vs. PV make any sense for cosmics? I guess not - } - //---------- THE PART ABOVE HAS TO BE CLEANED UP. THE PARAMETER DEFINER WAS NOT MEANT TO BE USED IN THIS WAY ---------- - - // in the coming lines, histos are filled using as input - // - momentumTP - // - vertexTP - // - dxySim - // - dzSim - if(!doSimTrackPlots_) + double dR = dR_tPCeff[iTP]; + double dR_jet = dR_tPCeff_jet[iTP]; + + //---------- THIS PART HAS TO BE CLEANED UP. THE PARAMETER DEFINER WAS NOT MEANT TO BE USED IN THIS WAY ---------- + //If the TrackingParticle is collison like, get the momentum and vertex at production state + if (!parametersDefinerIsCosmic_) { + momentumTP = tp.momentum(); + vertexTP = tp.vertex(); + //Calcualte the impact parameters w.r.t. PCA + const TrackingParticle::Vector& momentum = std::get(momVert); + const TrackingParticle::Point& vertex = std::get(momVert); + dxySim = TrackingParticleIP::dxy(vertex, momentum, bs.position()); + dzSim = TrackingParticleIP::dz(vertex, momentum, bs.position()); + + if (theSimPVPosition) { + dxyPVSim = TrackingParticleIP::dxy(vertex, momentum, *theSimPVPosition); + dzPVSim = TrackingParticleIP::dz(vertex, momentum, *theSimPVPosition); + } + } + //If the TrackingParticle is comics, get the momentum and vertex at PCA + else { + momentumTP = std::get(momVert); + vertexTP = std::get(momVert); + dxySim = TrackingParticleIP::dxy(vertexTP, momentumTP, bs.position()); + dzSim = TrackingParticleIP::dz(vertexTP, momentumTP, bs.position()); + + // Do dxy and dz vs. PV make any sense for cosmics? I guess not + } + //---------- THE PART ABOVE HAS TO BE CLEANED UP. THE PARAMETER DEFINER WAS NOT MEANT TO BE USED IN THIS WAY ---------- + + // in the coming lines, histos are filled using as input + // - momentumTP + // - vertexTP + // - dxySim + // - dzSim + if (!doSimTrackPlots_) continue; - // ############################################## - // fill RecoAssociated SimTracks' histograms - // ############################################## - const reco::Track *matchedTrackPointer = nullptr; - const reco::Track *matchedSecondTrackPointer = nullptr; + // ############################################## + // fill RecoAssociated SimTracks' histograms + // ############################################## + const reco::Track* matchedTrackPointer = nullptr; + const reco::Track* matchedSecondTrackPointer = nullptr; unsigned int selectsLoose = mvaCollections.size(); unsigned int selectsHP = mvaCollections.size(); - if(simRecColl.find(tpr) != simRecColl.end()){ - auto const & rt = simRecColl[tpr]; - if (!rt.empty()) { - ats++; //This counter counts the number of simTracks that have a recoTrack associated - // isRecoMatched = true; // UNUSED - matchedTrackPointer = rt.begin()->first.get(); - if(rt.size() >= 2) { - matchedSecondTrackPointer = (rt.begin()+1)->first.get(); - } - LogTrace("TrackValidator") << "TrackingParticle #" << st - << " with pt=" << sqrt(momentumTP.perp2()) - << " associated with quality:" << rt.begin()->second <<"\n"; - - if(doMVAPlots_) { + if (simRecColl.find(tpr) != simRecColl.end()) { + auto const& rt = simRecColl[tpr]; + if (!rt.empty()) { + ats++; //This counter counts the number of simTracks that have a recoTrack associated + // isRecoMatched = true; // UNUSED + matchedTrackPointer = rt.begin()->first.get(); + if (rt.size() >= 2) { + matchedSecondTrackPointer = (rt.begin() + 1)->first.get(); + } + LogTrace("TrackValidator") << "TrackingParticle #" << st << " with pt=" << sqrt(momentumTP.perp2()) + << " associated with quality:" << rt.begin()->second << "\n"; + + if (doMVAPlots_) { // for each MVA we need to take the value of the track // with largest MVA value (for the cumulative histograms) // // also identify the first MVA that possibly selects any // track matched to this TrackingParticle, separately // for loose and highPurity qualities - for(size_t imva=0; imvafirst.key()]; - for(; iMatch!=rt.end(); ++iMatch) { + for (; iMatch != rt.end(); ++iMatch) { auto itrk = iMatch->first.key(); maxMva = std::max(maxMva, mva[itrk]); - if(selectsLoose >= imva && trackSelected(qual[itrk], reco::TrackBase::loose)) + if (selectsLoose >= imva && trackSelected(qual[itrk], reco::TrackBase::loose)) selectsLoose = imva; - if(selectsHP >= imva && trackSelected(qual[itrk], reco::TrackBase::highPurity)) + if (selectsHP >= imva && trackSelected(qual[itrk], reco::TrackBase::highPurity)) selectsHP = imva; } mvaValues.push_back(maxMva); } } - } - }else{ - LogTrace("TrackValidator") - << "TrackingParticle #" << st - << " with pt,eta,phi: " - << sqrt(momentumTP.perp2()) << " , " - << momentumTP.eta() << " , " - << momentumTP.phi() << " , " - << " NOT associated to any reco::Track" << "\n"; - } - - - + } + } else { + LogTrace("TrackValidator") << "TrackingParticle #" << st << " with pt,eta,phi: " << sqrt(momentumTP.perp2()) + << " , " << momentumTP.eta() << " , " << momentumTP.phi() << " , " + << " NOT associated to any reco::Track" + << "\n"; + } int nSimHits = tp.numberOfTrackerHits(); int nSimLayers = nLayers_tPCeff[tpr]; int nSimPixelLayers = nPixelLayers_tPCeff[tpr]; int nSimStripMonoAndStereoLayers = nStripMonoAndStereoLayers_tPCeff[tpr]; - histoProducerAlgo_->fill_recoAssociated_simTrack_histos(histograms.histoProducerAlgo,w,tp,momentumTP,vertexTP,dxySim,dzSim,dxyPVSim,dzPVSim,nSimHits,nSimLayers,nSimPixelLayers,nSimStripMonoAndStereoLayers,matchedTrackPointer,puinfo.getPU_NumInteractions(), dR, dR_jet, thePVposition, theSimPVPosition, bs.position(), mvaValues, selectsLoose, selectsHP); + histoProducerAlgo_->fill_recoAssociated_simTrack_histos(histograms.histoProducerAlgo, + w, + tp, + momentumTP, + vertexTP, + dxySim, + dzSim, + dxyPVSim, + dzPVSim, + nSimHits, + nSimLayers, + nSimPixelLayers, + nSimStripMonoAndStereoLayers, + matchedTrackPointer, + puinfo.getPU_NumInteractions(), + dR, + dR_jet, + thePVposition, + theSimPVPosition, + bs.position(), + mvaValues, + selectsLoose, + selectsHP); mvaValues.clear(); - if(matchedTrackPointer && matchedSecondTrackPointer) { - histoProducerAlgo_->fill_duplicate_histos(histograms.histoProducerAlgo,w, *matchedTrackPointer, *matchedSecondTrackPointer); + if (matchedTrackPointer && matchedSecondTrackPointer) { + histoProducerAlgo_->fill_duplicate_histos( + histograms.histoProducerAlgo, w, *matchedTrackPointer, *matchedSecondTrackPointer); } - if(doSummaryPlots_) { - if(dRtpSelector(tp)) { - histograms.h_simul_coll[ww].fill(www); - if (matchedTrackPointer) { - histograms.h_assoc_coll[ww].fill(www); - } + if (doSummaryPlots_) { + if (dRtpSelector(tp)) { + histograms.h_simul_coll[ww].fill(www); + if (matchedTrackPointer) { + histograms.h_assoc_coll[ww].fill(www); } } + } - - - - } // End for (TrackingParticleCollection::size_type i=0; i *trackCollectionDr = &trackCollection; - if(calculateDrSingleCollection_) { + const edm::View* trackCollectionDr = &trackCollection; + if (calculateDrSingleCollection_) { trackCollectionDr = trackCollectionForDrCalculation.product(); } declareDynArray(float, trackCollection.size(), dR_trk); declareDynArray(float, trackCollection.size(), dR_trk_jet); trackDR(trackCollection, *trackCollectionDr, dR_trk, dR_trk_jet, coresVector); - for(View::size_type i=0; i::size_type i = 0; i < trackCollection.size(); ++i) { auto track = trackCollection.refAt(i); - rT++; - if(trackFromSeedFitFailed(*track)) ++seed_fit_failed; - if((*dRTrackSelector)(*track, bs.position())) ++n_selTrack_dr; - - bool isSigSimMatched(false); - bool isSimMatched(false); + rT++; + if (trackFromSeedFitFailed(*track)) + ++seed_fit_failed; + if ((*dRTrackSelector)(*track, bs.position())) + ++n_selTrack_dr; + + bool isSigSimMatched(false); + bool isSimMatched(false); bool isChargeMatched(true); int numAssocRecoTracks = 0; - int nSimHits = 0; - double sharedFraction = 0.; + int nSimHits = 0; + double sharedFraction = 0.; auto tpFound = recSimColl.find(track); isSimMatched = tpFound != recSimColl.end(); if (isSimMatched) { - const auto& tp = tpFound->val; - nSimHits = tp[0].first->numberOfTrackerHits(); - sharedFraction = tp[0].second; - if (tp[0].first->charge() != track->charge()) isChargeMatched = false; - if(simRecColl.find(tp[0].first) != simRecColl.end()) numAssocRecoTracks = simRecColl[tp[0].first].size(); - at++; - for (unsigned int tp_ite=0;tp_iteval; + nSimHits = tp[0].first->numberOfTrackerHits(); + sharedFraction = tp[0].second; + if (tp[0].first->charge() != track->charge()) + isChargeMatched = false; + if (simRecColl.find(tp[0].first) != simRecColl.end()) + numAssocRecoTracks = simRecColl[tp[0].first].size(); + at++; + for (unsigned int tp_ite = 0; tp_ite < tp.size(); ++tp_ite) { + TrackingParticle trackpart = *(tp[tp_ite].first); + if ((trackpart.eventId().event() == 0) && (trackpart.eventId().bunchCrossing() == 0)) { + isSigSimMatched = true; + sat++; + break; } - LogTrace("TrackValidator") << "reco::Track #" << rT << " with pt=" << track->pt() - << " associated with quality:" << tp.begin()->second <<"\n"; - } else { - LogTrace("TrackValidator") << "reco::Track #" << rT << " with pt=" << track->pt() - << " NOT associated to any TrackingParticle" << "\n"; - } + } + LogTrace("TrackValidator") << "reco::Track #" << rT << " with pt=" << track->pt() + << " associated with quality:" << tp.begin()->second << "\n"; + } else { + LogTrace("TrackValidator") << "reco::Track #" << rT << " with pt=" << track->pt() + << " NOT associated to any TrackingParticle" + << "\n"; + } // set MVA values for this track // take also the indices of first MVAs to select by loose and // HP quality unsigned int selectsLoose = mvaCollections.size(); unsigned int selectsHP = mvaCollections.size(); - if(doMVAPlots_) { - for(size_t imva=0; imva= imva && trackSelected(qual[i], reco::TrackBase::loose)) + if (selectsLoose >= imva && trackSelected(qual[i], reco::TrackBase::loose)) selectsLoose = imva; - if(selectsHP >= imva && trackSelected(qual[i], reco::TrackBase::highPurity)) + if (selectsHP >= imva && trackSelected(qual[i], reco::TrackBase::highPurity)) selectsHP = imva; } } - double dR=dR_trk[i]; - double dR_jet=dR_trk_jet[i]; - histoProducerAlgo_->fill_generic_recoTrack_histos(histograms.histoProducerAlgo,w,*track, ttopo, bs.position(), thePVposition, theSimPVPosition, isSimMatched,isSigSimMatched, isChargeMatched, numAssocRecoTracks, puinfo.getPU_NumInteractions(), nSimHits, sharedFraction, dR, dR_jet, mvaValues, selectsLoose, selectsHP); + double dR = dR_trk[i]; + double dR_jet = dR_trk_jet[i]; + histoProducerAlgo_->fill_generic_recoTrack_histos(histograms.histoProducerAlgo, + w, + *track, + ttopo, + bs.position(), + thePVposition, + theSimPVPosition, + isSimMatched, + isSigSimMatched, + isChargeMatched, + numAssocRecoTracks, + puinfo.getPU_NumInteractions(), + nSimHits, + sharedFraction, + dR, + dR_jet, + mvaValues, + selectsLoose, + selectsHP); mvaValues.clear(); - if(doSummaryPlots_) { + if (doSummaryPlots_) { histograms.h_reco_coll[ww].fill(www); - if(isSimMatched) { + if (isSimMatched) { histograms.h_assoc2_coll[ww].fill(www); - if(numAssocRecoTracks>1) { + if (numAssocRecoTracks > 1) { histograms.h_looper_coll[ww].fill(www); } - if(!isSigSimMatched) { + if (!isSigSimMatched) { histograms.h_pileup_coll[ww].fill(www); } } } - // dE/dx - if (dodEdxPlots_) histoProducerAlgo_->fill_dedx_recoTrack_histos(histograms.histoProducerAlgo,w,track, v_dEdx); - + // dE/dx + if (dodEdxPlots_) + histoProducerAlgo_->fill_dedx_recoTrack_histos(histograms.histoProducerAlgo, w, track, v_dEdx); - //Fill other histos - if (!isSimMatched) continue; + //Fill other histos + if (!isSimMatched) + continue; - histoProducerAlgo_->fill_simAssociated_recoTrack_histos(histograms.histoProducerAlgo,w,*track); + histoProducerAlgo_->fill_simAssociated_recoTrack_histos(histograms.histoProducerAlgo, w, *track); - /* TO BE FIXED LATER + /* TO BE FIXED LATER if (associators[ww]=="trackAssociatorByChi2"){ //association chi2 double assocChi2 = -tp.begin()->second;//in association map is stored -chi2 @@ -1066,41 +1152,38 @@ void MultiTrackValidator::dqmAnalyze(const edm::Event& event, const edm::EventSe } */ - - if(doResolutionPlots_[www]) { + if (doResolutionPlots_[www]) { //Get tracking particle parameters at point of closest approach to the beamline TrackingParticleRef tpr = tpFound->val.begin()->first; - TrackingParticle::Vector momentumTP = parametersDefinerTP->momentum(event,setup,tpr); - TrackingParticle::Point vertexTP = parametersDefinerTP->vertex(event,setup,tpr); + TrackingParticle::Vector momentumTP = parametersDefinerTP->momentum(event, setup, tpr); + TrackingParticle::Point vertexTP = parametersDefinerTP->vertex(event, setup, tpr); int chargeTP = tpr->charge(); - histoProducerAlgo_->fill_ResoAndPull_recoTrack_histos(histograms.histoProducerAlgo,w,momentumTP,vertexTP,chargeTP, - *track,bs.position()); + histoProducerAlgo_->fill_ResoAndPull_recoTrack_histos( + histograms.histoProducerAlgo, w, momentumTP, vertexTP, chargeTP, *track, bs.position()); } + //TO BE FIXED + //std::vector simhits=tpr.get()->trackPSimHit(DetId::Tracker); + //nrecHit_vs_nsimHit_rec2sim[w]->Fill(track->numberOfValidHits(), (int)(simhits.end()-simhits.begin() )); - //TO BE FIXED - //std::vector simhits=tpr.get()->trackPSimHit(DetId::Tracker); - //nrecHit_vs_nsimHit_rec2sim[w]->Fill(track->numberOfValidHits(), (int)(simhits.end()-simhits.begin() )); - - } // End of for(View::size_type i=0; i::size_type i=0; ifill_trackBased_histos(histograms.histoProducerAlgo,w,at,rT, n_selTrack_dr, n_selTP_dr); + histoProducerAlgo_->fill_trackBased_histos(histograms.histoProducerAlgo, w, at, rT, n_selTrack_dr, n_selTP_dr); // Fill seed-specific histograms - if(doSeedPlots_) { - histoProducerAlgo_->fill_seed_histos(histograms.histoProducerAlgo,www, seed_fit_failed, trackCollection.size()); + if (doSeedPlots_) { + histoProducerAlgo_->fill_seed_histos( + histograms.histoProducerAlgo, www, seed_fit_failed, trackCollection.size()); } - LogTrace("TrackValidator") << "Collection " << www << "\n" << "Total Simulated (selected): " << n_selTP_dr << "\n" << "Total Reconstructed (selected): " << n_selTrack_dr << "\n" << "Total Reconstructed: " << rT << "\n" << "Total Associated (recoToSim): " << at << "\n" - << "Total Fakes: " << rT-at << "\n"; - } // End of for (unsigned int www=0;www("ptMinGP"), - pset.getParameter("minRapidityGP"), - pset.getParameter("maxRapidityGP"), - pset.getParameter("tipGP"), - pset.getParameter("lipGP"), - pset.getParameter("chargedOnlyGP"), - pset.getParameter("statusGP"), - pset.getParameter >("pdgIdGP")); - - if(useAssociators_) { - for(auto const& src: associators) { - if( src.label() == kTrackAssociatorByChi2) { + pset.getParameter("minRapidityGP"), + pset.getParameter("maxRapidityGP"), + pset.getParameter("tipGP"), + pset.getParameter("lipGP"), + pset.getParameter("chargedOnlyGP"), + pset.getParameter("statusGP"), + pset.getParameter >("pdgIdGP")); + + if (useAssociators_) { + for (auto const& src : associators) { + if (src.label() == kTrackAssociatorByChi2) { label_gen_associator = consumes(src); break; } } - } - else { - for (auto const& src: associators) { + } else { + for (auto const& src : associators) { associatormapGtR = consumes(src); associatormapRtG = consumes(src); break; @@ -63,29 +61,33 @@ MultiTrackValidatorGenPs::MultiTrackValidatorGenPs(const edm::ParameterSet& pset } } -MultiTrackValidatorGenPs::~MultiTrackValidatorGenPs(){} +MultiTrackValidatorGenPs::~MultiTrackValidatorGenPs() {} - -void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event, const edm::EventSetup& setup, const Histograms& histograms) const { +void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event, + const edm::EventSetup& setup, + const Histograms& histograms) const { using namespace reco; - edm::LogInfo("TrackValidator") << "\n====================================================" << "\n" - << "Analyzing new event" << "\n" - << "====================================================\n" << "\n"; + edm::LogInfo("TrackValidator") << "\n====================================================" + << "\n" + << "Analyzing new event" + << "\n" + << "====================================================\n" + << "\n"; edm::ESHandle parametersDefinerTP; - setup.get().get(parametersDefiner,parametersDefinerTP); + setup.get().get(parametersDefiner, parametersDefinerTP); edm::ESHandle httopo; setup.get().get(httopo); const TrackerTopology& ttopo = *httopo; - edm::Handle TPCollectionHeff ; - event.getByToken(label_tp_effic,TPCollectionHeff); + edm::Handle TPCollectionHeff; + event.getByToken(label_tp_effic, TPCollectionHeff); const GenParticleCollection tPCeff = *(TPCollectionHeff.product()); - edm::Handle TPCollectionHfake ; - event.getByToken(label_tp_fake,TPCollectionHfake); + edm::Handle TPCollectionHfake; + event.getByToken(label_tp_fake, TPCollectionHfake); const GenParticleCollection tPCfake = *(TPCollectionHfake.product()); //if (tPCeff.size()==0) {edm::LogInfo("TrackValidator") @@ -94,40 +96,38 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event, const edm::Ev //<< "TP Collection for fake rate studies has size = 0! Skipping Event." ; return;} edm::Handle recoBeamSpotHandle; - event.getByToken(bsSrc,recoBeamSpotHandle); + event.getByToken(bsSrc, recoBeamSpotHandle); reco::BeamSpot bs = *recoBeamSpotHandle; - edm::Handle< vector > puinfoH; - event.getByToken(label_pileupinfo,puinfoH); + edm::Handle > puinfoH; + event.getByToken(label_pileupinfo, puinfoH); PileupSummaryInfo puinfo; - for (unsigned int puinfo_ite=0;puinfo_ite<(*puinfoH).size();++puinfo_ite){ - if ((*puinfoH)[puinfo_ite].getBunchCrossing()==0){ - puinfo=(*puinfoH)[puinfo_ite]; + for (unsigned int puinfo_ite = 0; puinfo_ite < (*puinfoH).size(); ++puinfo_ite) { + if ((*puinfoH)[puinfo_ite].getBunchCrossing() == 0) { + puinfo = (*puinfoH)[puinfo_ite]; break; } } - const reco::TrackToGenParticleAssociator* trackGenAssociator =nullptr; - if(useAssociators_) { - if(label_gen_associator.isUninitialized()) { + const reco::TrackToGenParticleAssociator* trackGenAssociator = nullptr; + if (useAssociators_) { + if (label_gen_associator.isUninitialized()) { return; - } - else { + } else { edm::Handle trackGenAssociatorH; - event.getByToken(label_gen_associator,trackGenAssociatorH); + event.getByToken(label_gen_associator, trackGenAssociatorH); trackGenAssociator = trackGenAssociatorH.product(); } - } - else if(associatormapGtR.isUninitialized()) { + } else if (associatormapGtR.isUninitialized()) { return; } // dE/dx // at some point this could be generalized, with a vector of tags and a corresponding vector of Handles // I'm writing the interface such to take vectors of ValueMaps - std::vector *> v_dEdx; - if(dodEdxPlots_) { + std::vector*> v_dEdx; + if (dodEdxPlots_) { edm::Handle > dEdx1Handle; edm::Handle > dEdx2Handle; event.getByToken(m_dEdx1Tag, dEdx1Handle); @@ -138,13 +138,14 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event, const edm::Ev std::vector mvaDummy; - int w=0; //counter counting the number of sets of histograms - for (unsigned int www=0;www > trackCollection; - if(!event.getByToken(labelToken[www], trackCollection)&&ignoremissingtkcollection_)continue; + edm::Handle > trackCollection; + if (!event.getByToken(labelToken[www], trackCollection) && ignoremissingtkcollection_) + continue; //if (trackCollection->size()==0) //edm::LogInfo("TrackValidator") << "TrackCollection size = 0!" ; //continue; @@ -152,37 +153,28 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event, const edm::Ev reco::RecoToGenCollection recGenColl; reco::GenToRecoCollection genRecColl; //associate tracks - if(useAssociators_){ - edm::LogVerbatim("TrackValidator") << "Analyzing " - << label[www].process()<<":" - << label[www].label()<<":" - << label[www].instance()<<" with " - << kTrackAssociatorByChi2 <<"\n"; - - LogTrace("TrackValidator") << "Calling associateRecoToGen method" << "\n"; - recGenColl=trackGenAssociator->associateRecoToGen(trackCollection, - TPCollectionHfake); - LogTrace("TrackValidator") << "Calling associateGenToReco method" << "\n"; - genRecColl=trackGenAssociator->associateGenToReco(trackCollection, - TPCollectionHeff); + if (useAssociators_) { + edm::LogVerbatim("TrackValidator") << "Analyzing " << label[www].process() << ":" << label[www].label() << ":" + << label[www].instance() << " with " << kTrackAssociatorByChi2 << "\n"; + + LogTrace("TrackValidator") << "Calling associateRecoToGen method" + << "\n"; + recGenColl = trackGenAssociator->associateRecoToGen(trackCollection, TPCollectionHfake); + LogTrace("TrackValidator") << "Calling associateGenToReco method" + << "\n"; + genRecColl = trackGenAssociator->associateGenToReco(trackCollection, TPCollectionHeff); + } else { + edm::LogVerbatim("TrackValidator") << "Analyzing " << label[www].process() << ":" << label[www].label() << ":" + << label[www].instance() << " with " << associators[0] << "\n"; + + Handle gentorecoCollectionH; + event.getByToken(associatormapGtR, gentorecoCollectionH); + genRecColl = *(gentorecoCollectionH.product()); + + Handle recotogenCollectionH; + event.getByToken(associatormapRtG, recotogenCollectionH); + recGenColl = *(recotogenCollectionH.product()); } - else{ - edm::LogVerbatim("TrackValidator") << "Analyzing " - << label[www].process()<<":" - << label[www].label()<<":" - << label[www].instance()<<" with " - << associators[0] << "\n"; - - Handle gentorecoCollectionH; - event.getByToken(associatormapGtR,gentorecoCollectionH); - genRecColl= *(gentorecoCollectionH.product()); - - Handle recotogenCollectionH; - event.getByToken(associatormapRtG,recotogenCollectionH); - recGenColl= *(recotogenCollectionH.product()); - } - - // ######################################################## // fill simulation histograms (LOOP OVER TRACKINGPARTICLES) @@ -191,47 +183,47 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event, const edm::Ev //compute number of tracks per eta interval // edm::LogVerbatim("TrackValidator") << "\n# of GenParticles: " << tPCeff.size() << "\n"; - int ats(0); //This counter counts the number of simTracks that are "associated" to recoTracks - int st(0); //This counter counts the number of simulated tracks passing the MTV selection (i.e. tpSelector(tp) ) - unsigned sts(0); //This counter counts the number of simTracks surviving the bunchcrossing cut - unsigned asts(0); //This counter counts the number of simTracks that are "associated" to recoTracks surviving the bunchcrossing cut - for (GenParticleCollection::size_type i=0; i(tpr.get()); + GenParticle* tp = const_cast(tpr.get()); TrackingParticle::Vector momentumTP; TrackingParticle::Point vertexTP; double dxyGen(0); double dzGen(0); - //---------- THIS PART HAS TO BE CLEANED UP. THE PARAMETER DEFINER WAS NOT MEANT TO BE USED IN THIS WAY ---------- //If the GenParticle is collison like, get the momentum and vertex at production state - if(!parametersDefinerIsCosmic_) - { - //fixme this one shold be implemented - if(! gpSelector(*tp)) continue; - momentumTP = tp->momentum(); - vertexTP = tp->vertex(); - //Calcualte the impact parameters w.r.t. PCA - TrackingParticle::Vector momentum = parametersDefinerTP->momentum(event,setup,*tp); - TrackingParticle::Point vertex = parametersDefinerTP->vertex(event,setup,*tp); - dxyGen = (-vertex.x()*sin(momentum.phi())+vertex.y()*cos(momentum.phi())); - dzGen = vertex.z() - (vertex.x()*momentum.x()+vertex.y()*momentum.y())/sqrt(momentum.perp2()) - * momentum.z()/sqrt(momentum.perp2()); - } + if (!parametersDefinerIsCosmic_) { + //fixme this one shold be implemented + if (!gpSelector(*tp)) + continue; + momentumTP = tp->momentum(); + vertexTP = tp->vertex(); + //Calcualte the impact parameters w.r.t. PCA + TrackingParticle::Vector momentum = parametersDefinerTP->momentum(event, setup, *tp); + TrackingParticle::Point vertex = parametersDefinerTP->vertex(event, setup, *tp); + dxyGen = (-vertex.x() * sin(momentum.phi()) + vertex.y() * cos(momentum.phi())); + dzGen = vertex.z() - (vertex.x() * momentum.x() + vertex.y() * momentum.y()) / sqrt(momentum.perp2()) * + momentum.z() / sqrt(momentum.perp2()); + } //If the GenParticle is comics, get the momentum and vertex at PCA - else - { - //if(! cosmictpSelector(*tp,&bs,event,setup)) continue; - momentumTP = parametersDefinerTP->momentum(event,setup,*tp); - vertexTP = parametersDefinerTP->vertex(event,setup,*tp); - dxyGen = (-vertexTP.x()*sin(momentumTP.phi())+vertexTP.y()*cos(momentumTP.phi())); - dzGen = vertexTP.z() - (vertexTP.x()*momentumTP.x()+vertexTP.y()*momentumTP.y())/sqrt(momentumTP.perp2()) - * momentumTP.z()/sqrt(momentumTP.perp2()); - } + else { + //if(! cosmictpSelector(*tp,&bs,event,setup)) continue; + momentumTP = parametersDefinerTP->momentum(event, setup, *tp); + vertexTP = parametersDefinerTP->vertex(event, setup, *tp); + dxyGen = (-vertexTP.x() * sin(momentumTP.phi()) + vertexTP.y() * cos(momentumTP.phi())); + dzGen = vertexTP.z() - (vertexTP.x() * momentumTP.x() + vertexTP.y() * momentumTP.y()) / + sqrt(momentumTP.perp2()) * momentumTP.z() / sqrt(momentumTP.perp2()); + } //---------- THE PART ABOVE HAS TO BE CLEANED UP. THE PARAMETER DEFINER WAS NOT MEANT TO BE USED IN THIS WAY ---------- - st++; //This counter counts the number of simulated tracks passing the MTV selection (i.e. tpSelector(tp) ) + st++; //This counter counts the number of simulated tracks passing the MTV selection (i.e. tpSelector(tp) ) // in the coming lines, histos are filled using as input // - momentumTP @@ -239,74 +231,73 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event, const edm::Ev // - dxyGen // - dzGen - if(doSimPlots_ && w == 0) { - histoProducerAlgo_->fill_generic_simTrack_histos(histograms.histoProducerAlgo,momentumTP,vertexTP, tp->collisionId());//fixme: check meaning of collisionId + if (doSimPlots_ && w == 0) { + histoProducerAlgo_->fill_generic_simTrack_histos(histograms.histoProducerAlgo, + momentumTP, + vertexTP, + tp->collisionId()); //fixme: check meaning of collisionId } - if(!doSimTrackPlots_) + if (!doSimTrackPlots_) continue; - // ############################################## // fill RecoAssociated GenTracks' histograms // ############################################## // bool isRecoMatched(false); // UNUSED - const reco::Track* matchedTrackPointer=nullptr; + const reco::Track* matchedTrackPointer = nullptr; std::vector, double> > rt; - if(genRecColl.find(tpr) != genRecColl.end()){ - rt = (std::vector, double> >) genRecColl[tpr]; + if (genRecColl.find(tpr) != genRecColl.end()) { + rt = (std::vector, double> >)genRecColl[tpr]; if (!rt.empty()) { - ats++; //This counter counts the number of simTracks that have a recoTrack associated + ats++; //This counter counts the number of simTracks that have a recoTrack associated // isRecoMatched = true; // UNUSED matchedTrackPointer = rt.begin()->first.get(); - edm::LogVerbatim("TrackValidator") << "GenParticle #" << st - << " with pt=" << sqrt(momentumTP.perp2()) - << " associated with quality:" << rt.begin()->second <<"\n"; + edm::LogVerbatim("TrackValidator") << "GenParticle #" << st << " with pt=" << sqrt(momentumTP.perp2()) + << " associated with quality:" << rt.begin()->second << "\n"; } - }else{ - edm::LogVerbatim("TrackValidator") - << "GenParticle #" << st - << " with pt,eta,phi: " - << sqrt(momentumTP.perp2()) << " , " - << momentumTP.eta() << " , " - << momentumTP.phi() << " , " - << " NOT associated to any reco::Track" << "\n"; + } else { + edm::LogVerbatim("TrackValidator") << "GenParticle #" << st << " with pt,eta,phi: " << sqrt(momentumTP.perp2()) + << " , " << momentumTP.eta() << " , " << momentumTP.phi() << " , " + << " NOT associated to any reco::Track" + << "\n"; } - - int nSimHits = 0; - histoProducerAlgo_->fill_recoAssociated_simTrack_histos(histograms.histoProducerAlgo,w,*tp,momentumTP,vertexTP,dxyGen,dzGen,nSimHits,matchedTrackPointer,puinfo.getPU_NumInteractions()); + histoProducerAlgo_->fill_recoAssociated_simTrack_histos(histograms.histoProducerAlgo, + w, + *tp, + momentumTP, + vertexTP, + dxyGen, + dzGen, + nSimHits, + matchedTrackPointer, + puinfo.getPU_NumInteractions()); sts++; - if (matchedTrackPointer) asts++; - + if (matchedTrackPointer) + asts++; + } // End for (GenParticleCollection::size_type i=0; ifill_simTrackBased_histos(histograms.histoProducerAlgo,st); + if (doSimPlots_ && w == 0) { + histoProducerAlgo_->fill_simTrackBased_histos(histograms.histoProducerAlgo, st); } - - // ############################################## - // fill recoTracks histograms (LOOP OVER TRACKS) - // ############################################## - if(!doRecoTrackPlots_) + // ############################################## + // fill recoTracks histograms (LOOP OVER TRACKS) + // ############################################## + if (!doRecoTrackPlots_) continue; - edm::LogVerbatim("TrackValidator") << "\n# of reco::Tracks with " - << label[www].process()<<":" - << label[www].label()<<":" - << label[www].instance() - << ": " << trackCollection->size() << "\n"; + edm::LogVerbatim("TrackValidator") << "\n# of reco::Tracks with " << label[www].process() << ":" + << label[www].label() << ":" << label[www].instance() << ": " + << trackCollection->size() << "\n"; //int sat(0); //This counter counts the number of recoTracks that are associated to GenTracks from Signal only - int at(0); //This counter counts the number of recoTracks that are associated to GenTracks - int rT(0); //This counter counts the number of recoTracks in general - - for(View::size_type i=0; isize(); ++i){ + int at(0); //This counter counts the number of recoTracks that are associated to GenTracks + int rT(0); //This counter counts the number of recoTracks in general + for (View::size_type i = 0; i < trackCollection->size(); ++i) { RefToBase track(trackCollection, i); rT++; @@ -317,7 +308,7 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event, const edm::Ev int nSimHits = 0; double sharedFraction = 0.; std::vector > tp; - if(recGenColl.find(track) != recGenColl.end()){ + if (recGenColl.find(track) != recGenColl.end()) { tp = recGenColl[track]; if (!tp.empty()) { /* @@ -326,11 +317,13 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event, const edm::Ev */ sharedFraction = tp[0].second; isGenMatched = true; - if (tp[0].first->charge() != track->charge()) isChargeMatched = false; - if(genRecColl.find(tp[0].first) != genRecColl.end()) numAssocRecoTracks = genRecColl[tp[0].first].size(); + if (tp[0].first->charge() != track->charge()) + isChargeMatched = false; + if (genRecColl.find(tp[0].first) != genRecColl.end()) + numAssocRecoTracks = genRecColl[tp[0].first].size(); //std::cout << numAssocRecoTracks << std::endl; at++; - for (unsigned int tp_ite=0;tp_itesecond <<"\n"; + << " associated with quality:" << tp.begin()->second << "\n"; } } else { - edm::LogVerbatim("TrackValidator") << "reco::Track #" << rT << " with pt=" << track->pt() - << " NOT associated to any GenParticle" << "\n"; + edm::LogVerbatim("TrackValidator") + << "reco::Track #" << rT << " with pt=" << track->pt() << " NOT associated to any GenParticle" + << "\n"; } - - double dR=0;//fixme: plots vs dR and vs dRjet not implemented for now - histoProducerAlgo_->fill_generic_recoTrack_histos(histograms.histoProducerAlgo,w,*track, ttopo, bs.position(), nullptr, nullptr, isGenMatched,isSigGenMatched, isChargeMatched, numAssocRecoTracks, puinfo.getPU_NumInteractions(), nSimHits, sharedFraction, dR, dR, mvaDummy, 0, 0); + double dR = 0; //fixme: plots vs dR and vs dRjet not implemented for now + histoProducerAlgo_->fill_generic_recoTrack_histos(histograms.histoProducerAlgo, + w, + *track, + ttopo, + bs.position(), + nullptr, + nullptr, + isGenMatched, + isSigGenMatched, + isChargeMatched, + numAssocRecoTracks, + puinfo.getPU_NumInteractions(), + nSimHits, + sharedFraction, + dR, + dR, + mvaDummy, + 0, + 0); // dE/dx - if (dodEdxPlots_) histoProducerAlgo_->fill_dedx_recoTrack_histos(histograms.histoProducerAlgo,w,track, v_dEdx); - + if (dodEdxPlots_) + histoProducerAlgo_->fill_dedx_recoTrack_histos(histograms.histoProducerAlgo, w, track, v_dEdx); //Fill other histos //try{ //Is this really necessary ???? - if (tp.empty()) continue; + if (tp.empty()) + continue; - histoProducerAlgo_->fill_simAssociated_recoTrack_histos(histograms.histoProducerAlgo,w,*track); + histoProducerAlgo_->fill_simAssociated_recoTrack_histos(histograms.histoProducerAlgo, w, *track); GenParticleRef tpr = tp.begin()->first; @@ -379,15 +391,13 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event, const edm::Ev } */ - //Get tracking particle parameters at point of closest approach to the beamline - TrackingParticle::Vector momentumTP = parametersDefinerTP->momentum(event,setup,*(tpr.get())); - TrackingParticle::Point vertexTP = parametersDefinerTP->vertex(event,setup,*(tpr.get())); + TrackingParticle::Vector momentumTP = parametersDefinerTP->momentum(event, setup, *(tpr.get())); + TrackingParticle::Point vertexTP = parametersDefinerTP->vertex(event, setup, *(tpr.get())); int chargeTP = tpr->charge(); - histoProducerAlgo_->fill_ResoAndPull_recoTrack_histos(histograms.histoProducerAlgo,w,momentumTP,vertexTP,chargeTP, - *track,bs.position()); - + histoProducerAlgo_->fill_ResoAndPull_recoTrack_histos( + histograms.histoProducerAlgo, w, momentumTP, vertexTP, chargeTP, *track, bs.position()); //TO BE FIXED //std::vector simhits=tpr.get()->trackPSimHit(DetId::Tracker); @@ -400,16 +410,16 @@ void MultiTrackValidatorGenPs::dqmAnalyze(const edm::Event& event, const edm::Ev } */ - } // End of for(View::size_type i=0; isize(); ++i){ + } // End of for(View::size_type i=0; isize(); ++i){ - histoProducerAlgo_->fill_trackBased_histos(histograms.histoProducerAlgo,w,at,rT,rT,st); + histoProducerAlgo_->fill_trackBased_histos(histograms.histoProducerAlgo, w, at, rT, rT, st); edm::LogVerbatim("TrackValidator") << "Total Simulated: " << st << "\n" << "Total Associated (genToReco): " << ats << "\n" << "Total Reconstructed: " << rT << "\n" << "Total Associated (recoToGen): " << at << "\n" - << "Total Fakes: " << rT-at << "\n"; + << "Total Fakes: " << rT - at << "\n"; w++; - } // End of for (unsigned int www=0;www, - StringCutObjectSelector - > TrackSelectorForValidation; +typedef SingleObjectSelector, StringCutObjectSelector > TrackSelectorForValidation; DEFINE_FWK_MODULE(TrackSelectorForValidation); diff --git a/Validation/RecoTrack/plugins/SiPixelTrackingRecHitsValid.cc b/Validation/RecoTrack/plugins/SiPixelTrackingRecHitsValid.cc index 042a8081e4cc2..3a8e6ea5469f6 100644 --- a/Validation/RecoTrack/plugins/SiPixelTrackingRecHitsValid.cc +++ b/Validation/RecoTrack/plugins/SiPixelTrackingRecHitsValid.cc @@ -22,7 +22,7 @@ #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackExtra.h" -#include "DataFormats/DetId/interface/DetId.h" +#include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/GeometryVector/interface/LocalPoint.h" #include "DataFormats/GeometryVector/interface/GlobalPoint.h" @@ -40,93 +40,88 @@ #include "Geometry/CommonDetUnit/interface/GeomDetType.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" - #include #include // End job: write and close the ntuple file -void SiPixelTrackingRecHitsValid::endJob() -{ - if(!debugNtuple_.empty()){ - tfile_->Write(); - tfile_->Close(); +void SiPixelTrackingRecHitsValid::endJob() { + if (!debugNtuple_.empty()) { + tfile_->Write(); + tfile_->Close(); } } -void SiPixelTrackingRecHitsValid::beginJob() -{ +void SiPixelTrackingRecHitsValid::beginJob() { + if (!debugNtuple_.empty()) { + tfile_ = new TFile(debugNtuple_.c_str(), "RECREATE"); - if(!debugNtuple_.empty()){ - tfile_ = new TFile (debugNtuple_.c_str() , "RECREATE"); - t_ = new TTree("Ntuple", "Ntuple"); int bufsize = 64000; - + t_->Branch("subdetId", &subdetId, "subdetId/I", bufsize); - - t_->Branch("layer" , &layer , "layer/I" , bufsize); + + t_->Branch("layer", &layer, "layer/I", bufsize); t_->Branch("ladder", &ladder, "ladder/I", bufsize); - t_->Branch("mod" , &mod , "mod/I" , bufsize); - t_->Branch("side" , &side , "side/I" , bufsize); - t_->Branch("disk" , &disk , "disk/I" , bufsize); - t_->Branch("blade" , &blade , "blade/I" , bufsize); - t_->Branch("panel" , &panel , "panel/I" , bufsize); - t_->Branch("plaq" , &plaq , "plaq/I" , bufsize); - - t_->Branch("rechitx" , &rechitx , "rechitx/F" , bufsize); - t_->Branch("rechity" , &rechity , "rechity/F" , bufsize); - t_->Branch("rechitz" , &rechitz , "rechitz/F" , bufsize); - t_->Branch("rechiterrx" , &rechiterrx , "rechiterrx/F" , bufsize); - t_->Branch("rechiterry" , &rechiterry , "rechiterry/F" , bufsize); - t_->Branch("rechitresx" , &rechitresx , "rechitresx/F" , bufsize); - t_->Branch("rechitresy" , &rechitresy , "rechitresy/F" , bufsize); + t_->Branch("mod", &mod, "mod/I", bufsize); + t_->Branch("side", &side, "side/I", bufsize); + t_->Branch("disk", &disk, "disk/I", bufsize); + t_->Branch("blade", &blade, "blade/I", bufsize); + t_->Branch("panel", &panel, "panel/I", bufsize); + t_->Branch("plaq", &plaq, "plaq/I", bufsize); + + t_->Branch("rechitx", &rechitx, "rechitx/F", bufsize); + t_->Branch("rechity", &rechity, "rechity/F", bufsize); + t_->Branch("rechitz", &rechitz, "rechitz/F", bufsize); + t_->Branch("rechiterrx", &rechiterrx, "rechiterrx/F", bufsize); + t_->Branch("rechiterry", &rechiterry, "rechiterry/F", bufsize); + t_->Branch("rechitresx", &rechitresx, "rechitresx/F", bufsize); + t_->Branch("rechitresy", &rechitresy, "rechitresy/F", bufsize); t_->Branch("rechitpullx", &rechitpullx, "rechitpullx/F", bufsize); t_->Branch("rechitpully", &rechitpully, "rechitpully/F", bufsize); - - t_->Branch("npix" , &npix , "npix/I" , bufsize); - t_->Branch("nxpix" , &nxpix , "nxpix/I" , bufsize); - t_->Branch("nypix" , &nypix , "nypix/I" , bufsize); + + t_->Branch("npix", &npix, "npix/I", bufsize); + t_->Branch("nxpix", &nxpix, "nxpix/I", bufsize); + t_->Branch("nypix", &nypix, "nypix/I", bufsize); t_->Branch("charge", &charge, "charge/F", bufsize); - + t_->Branch("alpha", &alpha, "alpha/F", bufsize); - t_->Branch("beta" , &beta , "beta/F" , bufsize); - + t_->Branch("beta", &beta, "beta/F", bufsize); + t_->Branch("phi", &phi, "phi/F", bufsize); t_->Branch("eta", &eta, "eta/F", bufsize); - - t_->Branch("half" , &half , "half/I" , bufsize); + + t_->Branch("half", &half, "half/I", bufsize); t_->Branch("flipped", &flipped, "flipped/I", bufsize); - + t_->Branch("simhitx", &simhitx, "simhitx/F", bufsize); t_->Branch("simhity", &simhity, "simhity/F", bufsize); t_->Branch("nsimhit", &nsimhit, "nsimhit/I", bufsize); - t_->Branch("pidhit" , &pidhit , "pidhit/I" , bufsize); - + t_->Branch("pidhit", &pidhit, "pidhit/I", bufsize); + t_->Branch("evt", &evt, "evt/I", bufsize); t_->Branch("run", &run, "run/I", bufsize); } - } -SiPixelTrackingRecHitsValid::SiPixelTrackingRecHitsValid(const edm::ParameterSet& ps) : - trackerHitAssociatorConfig_(ps, consumesCollector()), - dbe_(nullptr), tfile_(nullptr), t_(nullptr) -{ +SiPixelTrackingRecHitsValid::SiPixelTrackingRecHitsValid(const edm::ParameterSet& ps) + : trackerHitAssociatorConfig_(ps, consumesCollector()), dbe_(nullptr), tfile_(nullptr), t_(nullptr) { //Read config file MTCCtrack_ = ps.getParameter("MTCCtrack"); runStandalone = ps.getParameter("runStandalone"); outputFile_ = ps.getUntrackedParameter("outputFile", "pixeltrackingrechitshisto.root"); - siPixelRecHitCollectionToken_ = consumes( edm::InputTag( "siPixelRecHits" ) ); - recoTrackCollectionToken_ = consumes( edm::InputTag( ps.getUntrackedParameter( "src" ) ) ); - builderName_ = ps.getParameter("TTRHBuilder"); + siPixelRecHitCollectionToken_ = consumes(edm::InputTag("siPixelRecHits")); + recoTrackCollectionToken_ = + consumes(edm::InputTag(ps.getUntrackedParameter("src"))); + builderName_ = ps.getParameter("TTRHBuilder"); checkType_ = ps.getParameter("checkType"); genType_ = ps.getParameter("genType"); - debugNtuple_=ps.getUntrackedParameter("debugNtuple", "SiPixelTrackingRecHitsValid_Ntuple.root"); + debugNtuple_ = ps.getUntrackedParameter("debugNtuple", "SiPixelTrackingRecHitsValid_Ntuple.root"); } -void SiPixelTrackingRecHitsValid::bookHistograms(DQMStore::IBooker & ibooker,const edm::Run& run, const edm::EventSetup& es){ - +void SiPixelTrackingRecHitsValid::bookHistograms(DQMStore::IBooker& ibooker, + const edm::Run& run, + const edm::EventSetup& es) { // Book histograms dbe_ = edm::Service().operator->(); //dbe_->showDirStructure(); @@ -136,38 +131,38 @@ void SiPixelTrackingRecHitsValid::bookHistograms(DQMStore::IBooker & ibooker,con // Histogram ranges (low and high) - float xl = -1.0; - float xh = 1.0; + float xl = -1.0; + float xh = 1.0; float errxl = 0.0; float errxh = 0.003; float resxl = -0.02; - float resxh = 0.02; + float resxh = 0.02; float pullxl = -10.0; - float pullxh = 10.0; - + float pullxh = 10.0; + float yl = -4.0; - float yh = 4.0; + float yh = 4.0; float erryl = 0.0; float erryh = 0.010; float resyl = -0.04; - float resyh = 0.04; + float resyh = 0.04; float pullyl = -10.0; - float pullyh = 10.0; + float pullyh = 10.0; - float barrel_alphal = 80.0; + float barrel_alphal = 80.0; float barrel_alphah = 100.0; - float barrel_betal = 10.0; + float barrel_betal = 10.0; float barrel_betah = 170.0; //float barrel_phil = -180.0; //float barrel_phih = 180.0; //float barrel_etal = -2.5; //float barrel_etah = 2.5; - float forward_p1_alphal = 100.0; + float forward_p1_alphal = 100.0; float forward_p1_alphah = 115.0; - float forward_p2_alphal = 65.0; - float forward_p2_alphah = 80.0; - float forward_neg_betal = 67.0; + float forward_p2_alphal = 65.0; + float forward_p2_alphah = 80.0; + float forward_neg_betal = 67.0; float forward_neg_betah = 73.0; float forward_pos_betal = 107.0; float forward_pos_betah = 113.0; @@ -179,30 +174,30 @@ void SiPixelTrackingRecHitsValid::bookHistograms(DQMStore::IBooker & ibooker,con //float forward_pos_etah = 2.5; // special ranges for pulls - float pull_barrel_alphal = 80.0; + float pull_barrel_alphal = 80.0; float pull_barrel_alphah = 100.0; - float pull_barrel_betal = 10.0; + float pull_barrel_betal = 10.0; float pull_barrel_betah = 170.0; float pull_barrel_phil = -180.0; - float pull_barrel_phih = 180.0; + float pull_barrel_phih = 180.0; float pull_barrel_etal = -2.4; - float pull_barrel_etah = 2.4; + float pull_barrel_etah = 2.4; - float pull_forward_p1_alphal = 100.0; + float pull_forward_p1_alphal = 100.0; float pull_forward_p1_alphah = 112.0; - float pull_forward_p2_alphal = 68.0; - float pull_forward_p2_alphah = 80.0; - float pull_forward_neg_betal = 68.0; + float pull_forward_p2_alphal = 68.0; + float pull_forward_p2_alphah = 80.0; + float pull_forward_neg_betal = 68.0; float pull_forward_neg_betah = 72.0; float pull_forward_pos_betal = 108.0; float pull_forward_pos_betah = 112.0; float pull_forward_phil = -180.0; - float pull_forward_phih = 180.0; + float pull_forward_phih = 180.0; float pull_forward_neg_etal = -2.4; float pull_forward_neg_etah = -1.4; float pull_forward_pos_etal = 1.5; float pull_forward_pos_etah = 2.5; - + int npixl = 0; int npixh = 20; int nxpixl = 0; @@ -217,389 +212,398 @@ void SiPixelTrackingRecHitsValid::bookHistograms(DQMStore::IBooker & ibooker,con ibooker.setCurrentFolder("Tracking/TrackingRecHits/Pixel/Histograms_per_ring-layer_or_disk-plaquette"); - // Pixel barrel has 3 layers and 8 rings; book a histogram for each module given by the (layer, ring) pair - for (int i=0; i<3 ; i++) // loop over layers + // Pixel barrel has 3 layers and 8 rings; book a histogram for each module given by the (layer, ring) pair + for (int i = 0; i < 3; i++) // loop over layers + { + Char_t chisto[100]; + + sprintf(chisto, "meResxBarrelLayer_%d", i + 1); + meResxBarrelLayer[i] = ibooker.book1D(chisto, chisto, 100, resxl, resxh); + sprintf(chisto, "meResyBarrelLayer_%d", i + 1); + meResyBarrelLayer[i] = ibooker.book1D(chisto, chisto, 100, resyl, resyh); + sprintf(chisto, "mePullxBarrelLayer_%d", i + 1); + mePullxBarrelLayer[i] = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); + sprintf(chisto, "mePullyBarrelLayer_%d", i + 1); + mePullyBarrelLayer[i] = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); + + sprintf(chisto, "meResXvsAlphaBarrelFlippedLaddersLayer_%d", i + 1); + meResXvsAlphaBarrelFlippedLaddersLayer[i] = + ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsAlphaBarrelFlippedLaddersLayer_%d", i + 1); + meResYvsAlphaBarrelFlippedLaddersLayer[i] = + ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resyh, ""); + sprintf(chisto, "meResXvsBetaBarrelFlippedLaddersLayer_%d", i + 1); + meResXvsBetaBarrelFlippedLaddersLayer[i] = + ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsBetaBarrelFlippedLaddersLayer_%d", i + 1); + meResYvsBetaBarrelFlippedLaddersLayer[i] = + ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resyh, ""); + + sprintf(chisto, "meResXvsAlphaBarrelNonFlippedLaddersLayer_%d", i + 1); + meResXvsAlphaBarrelNonFlippedLaddersLayer[i] = + ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsAlphaBarrelNonFlippedLaddersLayer_%d", i + 1); + meResYvsAlphaBarrelNonFlippedLaddersLayer[i] = + ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resyh, ""); + sprintf(chisto, "meResXvsBetaBarrelNonFlippedLaddersLayer_%d", i + 1); + meResXvsBetaBarrelNonFlippedLaddersLayer[i] = + ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsBetaBarrelNonFlippedLaddersLayer_%d", i + 1); + meResYvsBetaBarrelNonFlippedLaddersLayer[i] = + ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resyh, ""); + + for (int j = 0; j < 8; j++) // loop over rings { - Char_t chisto[100]; + sprintf(chisto, "mePosxBarrelLayerModule_%d_%d", i + 1, j + 1); + mePosxBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, xl, xh); + sprintf(chisto, "mePosyBarrelLayerModule_%d_%d", i + 1, j + 1); + mePosyBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, yl, yh); + sprintf(chisto, "meErrxBarrelLayerModule_%d_%d", i + 1, j + 1); + meErrxBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, errxl, errxh); + sprintf(chisto, "meErryBarrelLayerModule_%d_%d", i + 1, j + 1); + meErryBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, erryl, erryh); + sprintf(chisto, "meResxBarrelLayerModule_%d_%d", i + 1, j + 1); + meResxBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, resxl, resxh); + sprintf(chisto, "meResyBarrelLayerModule_%d_%d", i + 1, j + 1); + meResyBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, resyl, resyh); + sprintf(chisto, "mePullxBarrelLayerModule_%d_%d", i + 1, j + 1); + mePullxBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); + sprintf(chisto, "mePullyBarrelLayerModule_%d_%d", i + 1, j + 1); + mePullyBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); + sprintf(chisto, "meNpixBarrelLayerModule_%d_%d", i + 1, j + 1); + meNpixBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, npixl, npixh); + sprintf(chisto, "meNxpixBarrelLayerModule_%d_%d", i + 1, j + 1); + meNxpixBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); + sprintf(chisto, "meNypixBarrelLayerModule_%d_%d", i + 1, j + 1); + meNypixBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); + sprintf(chisto, "meChargeBarrelLayerModule_%d_%d", i + 1, j + 1); + meChargeBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, barrel_chargel, barrel_chargeh); + + sprintf(chisto, "meResXvsAlphaBarrelLayerModule_%d_%d", i + 1, j + 1); + meResXvsAlphaBarrelLayerModule[i][j] = + ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsAlphaBarrelLayerModule_%d_%d", i + 1, j + 1); + meResYvsAlphaBarrelLayerModule[i][j] = + ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resyh, ""); + sprintf(chisto, "meResXvsBetaBarrelLayerModule_%d_%d", i + 1, j + 1); + meResXvsBetaBarrelLayerModule[i][j] = + ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsBetaBarrelLayerModule_%d_%d", i + 1, j + 1); + meResYvsBetaBarrelLayerModule[i][j] = + ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resyh, ""); + + sprintf(chisto, "mePullXvsAlphaBarrelLayerModule_%d_%d", i + 1, j + 1); + mePullXvsAlphaBarrelLayerModule[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsAlphaBarrelLayerModule_%d_%d", i + 1, j + 1); + mePullYvsAlphaBarrelLayerModule[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsBetaBarrelLayerModule_%d_%d", i + 1, j + 1); + mePullXvsBetaBarrelLayerModule[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsBetaBarrelLayerModule_%d_%d", i + 1, j + 1); + mePullYvsBetaBarrelLayerModule[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsPhiBarrelLayerModule_%d_%d", i + 1, j + 1); + mePullXvsPhiBarrelLayerModule[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsPhiBarrelLayerModule_%d_%d", i + 1, j + 1); + mePullYvsPhiBarrelLayerModule[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsEtaBarrelLayerModule_%d_%d", i + 1, j + 1); + mePullXvsEtaBarrelLayerModule[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsEtaBarrelLayerModule_%d_%d", i + 1, j + 1); + mePullYvsEtaBarrelLayerModule[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullyl, pullyh, ""); + } // for (int j=0; j<8; j++) // loop over rings + + } // for (int i=0; i<3 ; i++) // loop over layers - sprintf(chisto, "meResxBarrelLayer_%d", i+1); - meResxBarrelLayer[i] = ibooker.book1D(chisto, chisto, 100, resxl, resxh); - sprintf(chisto, "meResyBarrelLayer_%d", i+1); - meResyBarrelLayer[i] = ibooker.book1D(chisto, chisto, 100, resyl, resyh); - sprintf(chisto, "mePullxBarrelLayer_%d", i+1); - mePullxBarrelLayer[i] = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); - sprintf(chisto, "mePullyBarrelLayer_%d", i+1); - mePullyBarrelLayer[i] = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); - - sprintf(chisto, "meResXvsAlphaBarrelFlippedLaddersLayer_%d", i+1); - meResXvsAlphaBarrelFlippedLaddersLayer[i] = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsAlphaBarrelFlippedLaddersLayer_%d", i+1); - meResYvsAlphaBarrelFlippedLaddersLayer[i] = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resyh, ""); - sprintf(chisto, "meResXvsBetaBarrelFlippedLaddersLayer_%d", i+1); - meResXvsBetaBarrelFlippedLaddersLayer[i] = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsBetaBarrelFlippedLaddersLayer_%d", i+1); - meResYvsBetaBarrelFlippedLaddersLayer[i] = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resyh, ""); - - sprintf(chisto, "meResXvsAlphaBarrelNonFlippedLaddersLayer_%d", i+1); - meResXvsAlphaBarrelNonFlippedLaddersLayer[i] - = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsAlphaBarrelNonFlippedLaddersLayer_%d", i+1); - meResYvsAlphaBarrelNonFlippedLaddersLayer[i] - = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resyh, ""); - sprintf(chisto, "meResXvsBetaBarrelNonFlippedLaddersLayer_%d", i+1); - meResXvsBetaBarrelNonFlippedLaddersLayer[i] - = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsBetaBarrelNonFlippedLaddersLayer_%d", i+1); - meResYvsBetaBarrelNonFlippedLaddersLayer[i] - = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resyh, ""); - - for (int j=0; j<8; j++) // loop over rings - { - sprintf(chisto, "mePosxBarrelLayerModule_%d_%d", i+1, j+1); - mePosxBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, xl, xh); - sprintf(chisto, "mePosyBarrelLayerModule_%d_%d", i+1, j+1); - mePosyBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, yl, yh); - sprintf(chisto, "meErrxBarrelLayerModule_%d_%d", i+1, j+1); - meErrxBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, errxl, errxh); - sprintf(chisto, "meErryBarrelLayerModule_%d_%d", i+1, j+1); - meErryBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, erryl, erryh); - sprintf(chisto, "meResxBarrelLayerModule_%d_%d", i+1, j+1); - meResxBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, resxl, resxh); - sprintf(chisto, "meResyBarrelLayerModule_%d_%d", i+1, j+1); - meResyBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, resyl, resyh); - sprintf(chisto, "mePullxBarrelLayerModule_%d_%d", i+1, j+1); - mePullxBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); - sprintf(chisto, "mePullyBarrelLayerModule_%d_%d", i+1, j+1); - mePullyBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); - sprintf(chisto, "meNpixBarrelLayerModule_%d_%d", i+1, j+1); - meNpixBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, npixl, npixh); - sprintf(chisto, "meNxpixBarrelLayerModule_%d_%d", i+1, j+1); - meNxpixBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); - sprintf(chisto, "meNypixBarrelLayerModule_%d_%d", i+1, j+1); - meNypixBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); - sprintf(chisto, "meChargeBarrelLayerModule_%d_%d", i+1, j+1); - meChargeBarrelLayerModule[i][j] = ibooker.book1D(chisto, chisto, 100, barrel_chargel, barrel_chargeh); - - sprintf(chisto, "meResXvsAlphaBarrelLayerModule_%d_%d", i+1, j+1); - meResXvsAlphaBarrelLayerModule[i][j] = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsAlphaBarrelLayerModule_%d_%d", i+1, j+1); - meResYvsAlphaBarrelLayerModule[i][j] = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resyh, ""); - sprintf(chisto, "meResXvsBetaBarrelLayerModule_%d_%d", i+1, j+1); - meResXvsBetaBarrelLayerModule[i][j] = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsBetaBarrelLayerModule_%d_%d", i+1, j+1); - meResYvsBetaBarrelLayerModule[i][j] = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resyh, ""); - - sprintf(chisto, "mePullXvsAlphaBarrelLayerModule_%d_%d", i+1, j+1); - mePullXvsAlphaBarrelLayerModule[i][j] = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, - 100, pullxl, pullxh, ""); - sprintf(chisto, "mePullYvsAlphaBarrelLayerModule_%d_%d", i+1, j+1); - mePullYvsAlphaBarrelLayerModule[i][j] = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, - 100, pullyl, pullyh, ""); - sprintf(chisto, "mePullXvsBetaBarrelLayerModule_%d_%d", i+1, j+1); - mePullXvsBetaBarrelLayerModule[i][j] = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, - 100, pullxl, pullxh, ""); - sprintf(chisto, "mePullYvsBetaBarrelLayerModule_%d_%d", i+1, j+1); - mePullYvsBetaBarrelLayerModule[i][j] = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, - 100, pullyl, pullyh, ""); - sprintf(chisto, "mePullXvsPhiBarrelLayerModule_%d_%d", i+1, j+1); - mePullXvsPhiBarrelLayerModule[i][j] = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, - pullxl, pullxh, ""); - sprintf(chisto, "mePullYvsPhiBarrelLayerModule_%d_%d", i+1, j+1); - mePullYvsPhiBarrelLayerModule[i][j] = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, - 100, pullyl, pullyh, ""); - sprintf(chisto, "mePullXvsEtaBarrelLayerModule_%d_%d", i+1, j+1); - mePullXvsEtaBarrelLayerModule[i][j] = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, - 100, pullxl, pullxh, ""); - sprintf(chisto, "mePullYvsEtaBarrelLayerModule_%d_%d", i+1, j+1); - mePullYvsEtaBarrelLayerModule[i][j] = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, - 100, pullyl, pullyh, ""); - } // for (int j=0; j<8; j++) // loop over rings - - } // for (int i=0; i<3 ; i++) // loop over layers - // Pixel forward detector has 2 disks, 2 panels and either 3 or 4 plaquettes // Panel 1 has 4 plaquettes // Panel 2 has 3 plaquettes // Panel 1: 2 disks, 4 plaquets // Panel 2: 2 disks, 3 plaquets - for (int i=0; i<2 ; i++) // loop over disks - for (int j=0; j<4; j++) // loop over plaquettes - { - Char_t chisto[100]; - - sprintf(chisto, "mePosxZmPanel1DiskPlaq_%d_%d", i+1, j+1); - mePosxZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, xl, xh); - sprintf(chisto, "mePosyZmPanel1DiskPlaq_%d_%d", i+1, j+1); - mePosyZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, yl, yh); - sprintf(chisto, "meErrxZmPanel1DiskPlaq_%d_%d", i+1, j+1); - meErrxZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, errxl, errxh); - sprintf(chisto, "meErryZmPanel1DiskPlaq_%d_%d", i+1, j+1); - meErryZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, erryl, erryh); - sprintf(chisto, "meResxZmPanel1DiskPlaq_%d_%d", i+1, j+1); - meResxZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resxl, resxh); - sprintf(chisto, "meResyZmPanel1DiskPlaq_%d_%d", i+1, j+1); - meResyZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resyl, resyh); - sprintf(chisto, "mePullxZmPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullxZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); - sprintf(chisto, "mePullyZmPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullyZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); - sprintf(chisto, "meNpixZmPanel1DiskPlaq_%d_%d", i+1, j+1); - meNpixZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, npixl, npixh); - sprintf(chisto, "meNxpixZmPanel1DiskPlaq_%d_%d", i+1, j+1); - meNxpixZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); - sprintf(chisto, "meNypixZmPanel1DiskPlaq_%d_%d", i+1, j+1); - meNypixZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); - sprintf(chisto, "meChargeZmPanel1DiskPlaq_%d_%d", i+1, j+1); - meChargeZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); - - sprintf(chisto, "meResXvsAlphaZmPanel1DiskPlaq_%d_%d", i+1, j+1); - meResXvsAlphaZmPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsAlphaZmPanel1DiskPlaq_%d_%d", i+1, j+1); - meResYvsAlphaZmPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resyh, ""); - sprintf(chisto, "meResXvsBetaZmPanel1DiskPlaq_%d_%d", i+1, j+1); - meResXvsBetaZmPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsBetaZmPanel1DiskPlaq_%d_%d", i+1, j+1); - meResYvsBetaZmPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resyh, ""); - - sprintf(chisto, "mePullXvsAlphaZmPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullXvsAlphaZmPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsAlphaZmPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullYvsAlphaZmPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullyl,pullyh, ""); - sprintf(chisto, "mePullXvsBetaZmPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullXvsBetaZmPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsBetaZmPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullYvsBetaZmPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullyl,pullyh, ""); - sprintf(chisto, "mePullXvsPhiZmPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullXvsPhiZmPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsPhiZmPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullYvsPhiZmPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl,pullyh, ""); - sprintf(chisto, "mePullXvsEtaZmPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullXvsEtaZmPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsEtaZmPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullYvsEtaZmPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullyl,pullyh, ""); - - sprintf(chisto, "mePosxZpPanel1DiskPlaq_%d_%d", i+1, j+1); - mePosxZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, xl, xh); - sprintf(chisto, "mePosyZpPanel1DiskPlaq_%d_%d", i+1, j+1); - mePosyZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, yl, yh); - sprintf(chisto, "meErrxZpPanel1DiskPlaq_%d_%d", i+1, j+1); - meErrxZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, errxl, errxh); - sprintf(chisto, "meErryZpPanel1DiskPlaq_%d_%d", i+1, j+1); - meErryZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, erryl, erryh); - sprintf(chisto, "meResxZpPanel1DiskPlaq_%d_%d", i+1, j+1); - meResxZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resxl, resxh); - sprintf(chisto, "meResyZpPanel1DiskPlaq_%d_%d", i+1, j+1); - meResyZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resyl, resyh); - sprintf(chisto, "mePullxZpPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullxZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); - sprintf(chisto, "mePullyZpPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullyZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); - sprintf(chisto, "meNpixZpPanel1DiskPlaq_%d_%d", i+1, j+1); - meNpixZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, npixl, npixh); - sprintf(chisto, "meNxpixZpPanel1DiskPlaq_%d_%d", i+1, j+1); - meNxpixZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); - sprintf(chisto, "meNypixZpPanel1DiskPlaq_%d_%d", i+1, j+1); - meNypixZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); - sprintf(chisto, "meChargeZpPanel1DiskPlaq_%d_%d", i+1, j+1); - meChargeZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); - sprintf(chisto, "meResXvsAlphaZpPanel1DiskPlaq_%d_%d", i+1, j+1); - meResXvsAlphaZpPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsAlphaZpPanel1DiskPlaq_%d_%d", i+1, j+1); - meResYvsAlphaZpPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resyh, ""); - sprintf(chisto, "meResXvsBetaZpPanel1DiskPlaq_%d_%d", i+1, j+1); - meResXvsBetaZpPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsBetaZpPanel1DiskPlaq_%d_%d", i+1, j+1); - meResYvsBetaZpPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resyh, ""); - - sprintf(chisto, "mePullXvsAlphaZpPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullXvsAlphaZpPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsAlphaZpPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullYvsAlphaZpPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullyl,pullyh, ""); - sprintf(chisto, "mePullXvsBetaZpPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullXvsBetaZpPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsBetaZpPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullYvsBetaZpPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullyl,pullyh, ""); - sprintf(chisto, "mePullXvsPhiZpPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullXvsPhiZpPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsPhiZpPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullYvsPhiZpPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl,pullyh, ""); - sprintf(chisto, "mePullXvsEtaZpPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullXvsEtaZpPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsEtaZpPanel1DiskPlaq_%d_%d", i+1, j+1); - mePullYvsEtaZpPanel1DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullyl,pullyh, ""); - - if ( j>2 ) continue; // panel 2 has only 3 plaquettes - - sprintf(chisto, "mePosxZmPanel2DiskPlaq_%d_%d", i+1, j+1); - mePosxZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, xl, xh); - sprintf(chisto, "mePosyZmPanel2DiskPlaq_%d_%d", i+1, j+1); - mePosyZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, yl, yh); - sprintf(chisto, "meErrxZmPanel2DiskPlaq_%d_%d", i+1, j+1); - meErrxZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, errxl, errxh); - sprintf(chisto, "meErryZmPanel2DiskPlaq_%d_%d", i+1, j+1); - meErryZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, erryl, erryh); - sprintf(chisto, "meResxZmPanel2DiskPlaq_%d_%d", i+1, j+1); - meResxZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resxl, resxh); - sprintf(chisto, "meResyZmPanel2DiskPlaq_%d_%d", i+1, j+1); - meResyZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resyl, resyh); - sprintf(chisto, "mePullxZmPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullxZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); - sprintf(chisto, "mePullyZmPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullyZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); - sprintf(chisto, "meNpixZmPanel2DiskPlaq_%d_%d", i+1, j+1); - meNpixZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, npixl, npixh); - sprintf(chisto, "meNxpixZmPanel2DiskPlaq_%d_%d", i+1, j+1); - meNxpixZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); - sprintf(chisto, "meNypixZmPanel2DiskPlaq_%d_%d", i+1, j+1); - meNypixZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); - sprintf(chisto, "meChargeZmPanel2DiskPlaq_%d_%d", i+1, j+1); - meChargeZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); - sprintf(chisto, "meResXvsAlphaZmPanel2DiskPlaq_%d_%d", i+1, j+1); - meResXvsAlphaZmPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsAlphaZmPanel2DiskPlaq_%d_%d", i+1, j+1); - meResYvsAlphaZmPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resyh, ""); - sprintf(chisto, "meResXvsBetaZmPanel2DiskPlaq_%d_%d", i+1, j+1); - meResXvsBetaZmPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsBetaZmPanel2DiskPlaq_%d_%d", i+1, j+1); - meResYvsBetaZmPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resyh, ""); - - sprintf(chisto, "mePullXvsAlphaZmPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullXvsAlphaZmPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsAlphaZmPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullYvsAlphaZmPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullyl,pullyh, ""); - sprintf(chisto, "mePullXvsBetaZmPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullXvsBetaZmPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsBetaZmPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullYvsBetaZmPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullyl,pullyh, ""); - sprintf(chisto, "mePullXvsPhiZmPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullXvsPhiZmPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsPhiZmPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullYvsPhiZmPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl,pullyh, ""); - sprintf(chisto, "mePullXvsEtaZmPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullXvsEtaZmPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullxl, pullxh, ""); - sprintf(chisto, "mePullYvsEtaZmPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullYvsEtaZmPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullyl, pullyh, ""); - - sprintf(chisto, "mePosxZpPanel2DiskPlaq_%d_%d", i+1, j+1); - mePosxZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, xl, xh); - sprintf(chisto, "mePosyZpPanel2DiskPlaq_%d_%d", i+1, j+1); - mePosyZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, yl, yh); - sprintf(chisto, "meErrxZpPanel2DiskPlaq_%d_%d", i+1, j+1); - meErrxZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, errxl, errxh); - sprintf(chisto, "meErryZpPanel2DiskPlaq_%d_%d", i+1, j+1); - meErryZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, erryl, erryh); - sprintf(chisto, "meResxZpPanel2DiskPlaq_%d_%d", i+1, j+1); - meResxZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resxl, resxh); - sprintf(chisto, "meResyZpPanel2DiskPlaq_%d_%d", i+1, j+1); - meResyZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resyl, resyh); - sprintf(chisto, "mePullxZpPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullxZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); - sprintf(chisto, "mePullyZpPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullyZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); - sprintf(chisto, "meNpixZpPanel2DiskPlaq_%d_%d", i+1, j+1); - meNpixZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, npixl, npixh); - sprintf(chisto, "meNxpixZpPanel2DiskPlaq_%d_%d", i+1, j+1); - meNxpixZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); - sprintf(chisto, "meNypixZpPanel2DiskPlaq_%d_%d", i+1, j+1); - meNypixZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); - sprintf(chisto, "meChargeZpPanel2DiskPlaq_%d_%d", i+1, j+1); - meChargeZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); - sprintf(chisto, "meResXvsAlphaZpPanel2DiskPlaq_%d_%d", i+1, j+1); - meResXvsAlphaZpPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsAlphaZpPanel2DiskPlaq_%d_%d", i+1, j+1); - meResYvsAlphaZpPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resyh, ""); - sprintf(chisto, "meResXvsBetaZpPanel2DiskPlaq_%d_%d", i+1, j+1); - meResXvsBetaZpPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resxh, ""); - sprintf(chisto, "meResYvsBetaZpPanel2DiskPlaq_%d_%d", i+1, j+1); - meResYvsBetaZpPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resyh, ""); - - sprintf(chisto, "mePullXvsAlphaZpPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullXvsAlphaZpPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsAlphaZpPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullYvsAlphaZpPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullyl,pullyh, ""); - sprintf(chisto, "mePullXvsBetaZpPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullXvsBetaZpPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsBetaZpPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullYvsBetaZpPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullyl,pullyh, ""); - sprintf(chisto, "mePullXvsPhiZpPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullXvsPhiZpPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsPhiZpPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullYvsPhiZpPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl,pullyh, ""); - sprintf(chisto, "mePullXvsEtaZpPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullXvsEtaZpPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullxl,pullxh, ""); - sprintf(chisto, "mePullYvsEtaZpPanel2DiskPlaq_%d_%d", i+1, j+1); - mePullYvsEtaZpPanel2DiskPlaq[i][j] - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullyl,pullyh, ""); - - } // for (int j=0; j<4; j++) // loop over plaquettes + for (int i = 0; i < 2; i++) // loop over disks + for (int j = 0; j < 4; j++) // loop over plaquettes + { + Char_t chisto[100]; + + sprintf(chisto, "mePosxZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePosxZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, xl, xh); + sprintf(chisto, "mePosyZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePosyZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, yl, yh); + sprintf(chisto, "meErrxZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meErrxZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, errxl, errxh); + sprintf(chisto, "meErryZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meErryZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, erryl, erryh); + sprintf(chisto, "meResxZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meResxZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resxl, resxh); + sprintf(chisto, "meResyZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meResyZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resyl, resyh); + sprintf(chisto, "mePullxZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullxZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); + sprintf(chisto, "mePullyZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullyZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); + sprintf(chisto, "meNpixZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meNpixZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, npixl, npixh); + sprintf(chisto, "meNxpixZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meNxpixZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); + sprintf(chisto, "meNypixZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meNypixZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); + sprintf(chisto, "meChargeZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meChargeZmPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); + + sprintf(chisto, "meResXvsAlphaZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meResXvsAlphaZmPanel1DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsAlphaZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meResYvsAlphaZmPanel1DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resyh, ""); + sprintf(chisto, "meResXvsBetaZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meResXvsBetaZmPanel1DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsBetaZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meResYvsBetaZmPanel1DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resyh, ""); + + sprintf(chisto, "mePullXvsAlphaZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsAlphaZmPanel1DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsAlphaZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsAlphaZmPanel1DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsBetaZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsBetaZmPanel1DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsBetaZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsBetaZmPanel1DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsPhiZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsPhiZmPanel1DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsPhiZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsPhiZmPanel1DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsEtaZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsEtaZmPanel1DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsEtaZmPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsEtaZmPanel1DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullyl, pullyh, ""); + + sprintf(chisto, "mePosxZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePosxZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, xl, xh); + sprintf(chisto, "mePosyZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePosyZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, yl, yh); + sprintf(chisto, "meErrxZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meErrxZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, errxl, errxh); + sprintf(chisto, "meErryZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meErryZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, erryl, erryh); + sprintf(chisto, "meResxZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meResxZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resxl, resxh); + sprintf(chisto, "meResyZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meResyZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resyl, resyh); + sprintf(chisto, "mePullxZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullxZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); + sprintf(chisto, "mePullyZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullyZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); + sprintf(chisto, "meNpixZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meNpixZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, npixl, npixh); + sprintf(chisto, "meNxpixZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meNxpixZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); + sprintf(chisto, "meNypixZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meNypixZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); + sprintf(chisto, "meChargeZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meChargeZpPanel1DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); + sprintf(chisto, "meResXvsAlphaZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meResXvsAlphaZpPanel1DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsAlphaZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meResYvsAlphaZpPanel1DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resyh, ""); + sprintf(chisto, "meResXvsBetaZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meResXvsBetaZpPanel1DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsBetaZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + meResYvsBetaZpPanel1DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resyh, ""); + + sprintf(chisto, "mePullXvsAlphaZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsAlphaZpPanel1DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsAlphaZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsAlphaZpPanel1DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsBetaZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsBetaZpPanel1DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsBetaZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsBetaZpPanel1DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsPhiZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsPhiZpPanel1DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsPhiZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsPhiZpPanel1DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsEtaZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsEtaZpPanel1DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsEtaZpPanel1DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsEtaZpPanel1DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullyl, pullyh, ""); + + if (j > 2) + continue; // panel 2 has only 3 plaquettes + + sprintf(chisto, "mePosxZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePosxZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, xl, xh); + sprintf(chisto, "mePosyZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePosyZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, yl, yh); + sprintf(chisto, "meErrxZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meErrxZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, errxl, errxh); + sprintf(chisto, "meErryZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meErryZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, erryl, erryh); + sprintf(chisto, "meResxZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meResxZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resxl, resxh); + sprintf(chisto, "meResyZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meResyZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resyl, resyh); + sprintf(chisto, "mePullxZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullxZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); + sprintf(chisto, "mePullyZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullyZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); + sprintf(chisto, "meNpixZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meNpixZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, npixl, npixh); + sprintf(chisto, "meNxpixZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meNxpixZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); + sprintf(chisto, "meNypixZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meNypixZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); + sprintf(chisto, "meChargeZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meChargeZmPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); + sprintf(chisto, "meResXvsAlphaZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meResXvsAlphaZmPanel2DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsAlphaZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meResYvsAlphaZmPanel2DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resyh, ""); + sprintf(chisto, "meResXvsBetaZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meResXvsBetaZmPanel2DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsBetaZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meResYvsBetaZmPanel2DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resyh, ""); + + sprintf(chisto, "mePullXvsAlphaZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsAlphaZmPanel2DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsAlphaZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsAlphaZmPanel2DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsBetaZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsBetaZmPanel2DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsBetaZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsBetaZmPanel2DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsPhiZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsPhiZmPanel2DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsPhiZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsPhiZmPanel2DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsEtaZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsEtaZmPanel2DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsEtaZmPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsEtaZmPanel2DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullyl, pullyh, ""); + + sprintf(chisto, "mePosxZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePosxZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, xl, xh); + sprintf(chisto, "mePosyZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePosyZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, yl, yh); + sprintf(chisto, "meErrxZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meErrxZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, errxl, errxh); + sprintf(chisto, "meErryZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meErryZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, erryl, erryh); + sprintf(chisto, "meResxZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meResxZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resxl, resxh); + sprintf(chisto, "meResyZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meResyZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, resyl, resyh); + sprintf(chisto, "mePullxZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullxZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); + sprintf(chisto, "mePullyZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullyZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); + sprintf(chisto, "meNpixZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meNpixZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, npixl, npixh); + sprintf(chisto, "meNxpixZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meNxpixZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); + sprintf(chisto, "meNypixZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meNypixZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); + sprintf(chisto, "meChargeZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meChargeZpPanel2DiskPlaq[i][j] = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); + sprintf(chisto, "meResXvsAlphaZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meResXvsAlphaZpPanel2DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsAlphaZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meResYvsAlphaZpPanel2DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resyh, ""); + sprintf(chisto, "meResXvsBetaZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meResXvsBetaZpPanel2DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resxh, ""); + sprintf(chisto, "meResYvsBetaZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + meResYvsBetaZpPanel2DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resyh, ""); + + sprintf(chisto, "mePullXvsAlphaZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsAlphaZpPanel2DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsAlphaZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsAlphaZpPanel2DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsBetaZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsBetaZpPanel2DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsBetaZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsBetaZpPanel2DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsPhiZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsPhiZpPanel2DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsPhiZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsPhiZpPanel2DiskPlaq[i][j] = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl, pullyh, ""); + sprintf(chisto, "mePullXvsEtaZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullXvsEtaZpPanel2DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullxl, pullxh, ""); + sprintf(chisto, "mePullYvsEtaZpPanel2DiskPlaq_%d_%d", i + 1, j + 1); + mePullYvsEtaZpPanel2DiskPlaq[i][j] = ibooker.bookProfile( + chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullyl, pullyh, ""); + + } // for (int j=0; j<4; j++) // loop over plaquettes ibooker.setCurrentFolder("Tracking/TrackingRecHits/Pixel/Histograms_all"); Char_t chisto[100]; sprintf(chisto, "mePosxBarrel"); mePosxBarrel = ibooker.book1D(chisto, chisto, 100, xl, xh); - sprintf(chisto, "mePosyBarrel"); + sprintf(chisto, "mePosyBarrel"); mePosyBarrel = ibooker.book1D(chisto, chisto, 100, yl, yh); sprintf(chisto, "meErrxBarrel"); meErrxBarrel = ibooker.book1D(chisto, chisto, 100, errxl, errxh); sprintf(chisto, "meErryBarrel"); - meErryBarrel = ibooker.book1D(chisto, chisto, 100, erryl, erryh); + meErryBarrel = ibooker.book1D(chisto, chisto, 100, erryl, erryh); sprintf(chisto, "meResxBarrel"); meResxBarrel = ibooker.book1D(chisto, chisto, 100, resxl, resxh); sprintf(chisto, "meResyBarrel"); - meResyBarrel = ibooker.book1D(chisto, chisto, 100, resyl, resyh); + meResyBarrel = ibooker.book1D(chisto, chisto, 100, resyl, resyh); sprintf(chisto, "mePullxBarrel"); mePullxBarrel = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); sprintf(chisto, "mePullyBarrel"); - mePullyBarrel = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); + mePullyBarrel = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); sprintf(chisto, "meNpixBarrel"); meNpixBarrel = ibooker.book1D(chisto, chisto, 100, npixl, npixh); sprintf(chisto, "meNxpixBarrel"); @@ -611,28 +615,36 @@ void SiPixelTrackingRecHitsValid::bookHistograms(DQMStore::IBooker & ibooker,con sprintf(chisto, "meResXvsAlphaBarrel"); meResXvsAlphaBarrel = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsAlphaBarrel"); - meResYvsAlphaBarrel = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resyh, ""); + meResYvsAlphaBarrel = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resyh, ""); sprintf(chisto, "meResXvsBetaBarrel"); meResXvsBetaBarrel = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsBetaBarrel"); - meResYvsBetaBarrel = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resyh, ""); - + meResYvsBetaBarrel = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resyh, ""); + sprintf(chisto, "mePullXvsAlphaBarrel"); - mePullXvsAlphaBarrel = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullxl, pullxh, ""); + mePullXvsAlphaBarrel = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsAlphaBarrel"); - mePullYvsAlphaBarrel = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullyl, pullyh, ""); + mePullYvsAlphaBarrel = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsBetaBarrel"); - mePullXvsBetaBarrel = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullxl, pullxh, ""); + mePullXvsBetaBarrel = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsBetaBarrel"); - mePullYvsBetaBarrel = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullyl, pullyh, ""); + mePullYvsBetaBarrel = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsPhiBarrel"); - mePullXvsPhiBarrel = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullxl, pullxh, ""); + mePullXvsPhiBarrel = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsPhiBarrel"); - mePullYvsPhiBarrel = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullyl, pullyh, ""); + mePullYvsPhiBarrel = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsEtaBarrel"); - mePullXvsEtaBarrel = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullxl, pullxh, ""); + mePullXvsEtaBarrel = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsEtaBarrel"); - mePullYvsEtaBarrel = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullyl, pullyh, ""); + mePullYvsEtaBarrel = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePosxBarrelHalfModule"); mePosxBarrelHalfModule = ibooker.book1D(chisto, chisto, 100, xl, xh); @@ -650,103 +662,108 @@ void SiPixelTrackingRecHitsValid::bookHistograms(DQMStore::IBooker & ibooker,con mePosyBarrelFlippedLadders = ibooker.book1D(chisto, chisto, 100, yl, yh); sprintf(chisto, "mePosyBarrelNonFlippedLadders"); mePosyBarrelNonFlippedLadders = ibooker.book1D(chisto, chisto, 100, yl, yh); - + sprintf(chisto, "meResXvsAlphaBarrelFlippedLadders"); - meResXvsAlphaBarrelFlippedLadders = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resxh, ""); + meResXvsAlphaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsAlphaBarrelFlippedLadders"); - meResYvsAlphaBarrelFlippedLadders = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resyh, ""); + meResYvsAlphaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resyh, ""); sprintf(chisto, "meResXvsBetaBarrelFlippedLadders"); - meResXvsBetaBarrelFlippedLadders = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resxh, ""); + meResXvsBetaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsBetaBarrelFlippedLadders"); - meResYvsBetaBarrelFlippedLadders = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resyh, ""); + meResYvsBetaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resyh, ""); sprintf(chisto, "mePullXvsAlphaBarrelFlippedLadders"); - mePullXvsAlphaBarrelFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullxl, pullxh, ""); + mePullXvsAlphaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsAlphaBarrelFlippedLadders"); - mePullYvsAlphaBarrelFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullyl, pullyh, ""); + mePullYvsAlphaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsBetaBarrelFlippedLadders"); - mePullXvsBetaBarrelFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullxl, pullxh, ""); + mePullXvsBetaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsBetaBarrelFlippedLadders"); - mePullYvsBetaBarrelFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullyl, pullyh, ""); + mePullYvsBetaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsPhiBarrelFlippedLadders"); - mePullXvsPhiBarrelFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullxl, pullxh, ""); + mePullXvsPhiBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsPhiBarrelFlippedLadders"); - mePullYvsPhiBarrelFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullyl, pullyh, ""); + mePullYvsPhiBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsEtaBarrelFlippedLadders"); - mePullXvsEtaBarrelFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullxl, pullxh, ""); + mePullXvsEtaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsEtaBarrelFlippedLadders"); - mePullYvsEtaBarrelFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullyl, pullyh, ""); + mePullYvsEtaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullyl, pullyh, ""); - sprintf(chisto, "meWPullXvsAlphaBarrelFlippedLadders"); - meWPullXvsAlphaBarrelFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullxl, pullxh, ""); + meWPullXvsAlphaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "meWPullYvsAlphaBarrelFlippedLadders"); - meWPullYvsAlphaBarrelFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullyl, pullyh, ""); + meWPullYvsAlphaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "meWPullXvsBetaBarrelFlippedLadders"); - meWPullXvsBetaBarrelFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullxl, pullxh, ""); + meWPullXvsBetaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "meWPullYvsBetaBarrelFlippedLadders"); - meWPullYvsBetaBarrelFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullyl, pullyh, ""); - + meWPullYvsBetaBarrelFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullyl, pullyh, ""); + sprintf(chisto, "meResXvsAlphaBarrelNonFlippedLadders"); - meResXvsAlphaBarrelNonFlippedLadders = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resxh, ""); + meResXvsAlphaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsAlphaBarrelNonFlippedLadders"); - meResYvsAlphaBarrelNonFlippedLadders = ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resyh, ""); + meResYvsAlphaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, barrel_alphal, barrel_alphah, 100, 0.0, resyh, ""); sprintf(chisto, "meResXvsBetaBarrelNonFlippedLadders"); - meResXvsBetaBarrelNonFlippedLadders = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resxh, ""); + meResXvsBetaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsBetaBarrelNonFlippedLadders"); - meResYvsBetaBarrelNonFlippedLadders = ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resyh, ""); + meResYvsBetaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, barrel_betal, barrel_betah, 100, 0.0, resyh, ""); sprintf(chisto, "mePullXvsAlphaBarrelNonFlippedLadders"); - mePullXvsAlphaBarrelNonFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullxl, pullxh, ""); + mePullXvsAlphaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsAlphaBarrelNonFlippedLadders"); - mePullYvsAlphaBarrelNonFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullyl, pullyh, ""); + mePullYvsAlphaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsBetaBarrelNonFlippedLadders"); - mePullXvsBetaBarrelNonFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullxl, pullxh, ""); + mePullXvsBetaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsBetaBarrelNonFlippedLadders"); - mePullYvsBetaBarrelNonFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullyl, pullyh, ""); + mePullYvsBetaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsPhiBarrelNonFlippedLadders"); - mePullXvsPhiBarrelNonFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullxl, pullxh, ""); + mePullXvsPhiBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsPhiBarrelNonFlippedLadders"); - mePullYvsPhiBarrelNonFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullyl, pullyh, ""); + mePullYvsPhiBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_phil, pull_barrel_phih, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsEtaBarrelNonFlippedLadders"); - mePullXvsEtaBarrelNonFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullxl, pullxh, ""); + mePullXvsEtaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsEtaBarrelNonFlippedLadders"); - mePullYvsEtaBarrelNonFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullyl, pullyh, ""); - + mePullYvsEtaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_etal, pull_barrel_etah, 100, pullyl, pullyh, ""); sprintf(chisto, "meWPullXvsAlphaBarrelNonFlippedLadders"); - meWPullXvsAlphaBarrelNonFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullxl, pullxh, ""); + meWPullXvsAlphaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "meWPullYvsAlphaBarrelNonFlippedLadders"); - meWPullYvsAlphaBarrelNonFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullyl, pullyh, ""); + meWPullYvsAlphaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_alphal, pull_barrel_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "meWPullXvsBetaBarrelNonFlippedLadders"); - meWPullXvsBetaBarrelNonFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullxl, pullxh, ""); + meWPullXvsBetaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "meWPullYvsBetaBarrelNonFlippedLadders"); - meWPullYvsBetaBarrelNonFlippedLadders - = ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullyl, pullyh, ""); - + meWPullYvsBetaBarrelNonFlippedLadders = + ibooker.bookProfile(chisto, chisto, 20, pull_barrel_betal, pull_barrel_betah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePosxZmPanel1"); mePosxZmPanel1 = ibooker.book1D(chisto, chisto, 100, xl, xh); @@ -755,69 +772,73 @@ void SiPixelTrackingRecHitsValid::bookHistograms(DQMStore::IBooker & ibooker,con sprintf(chisto, "meErrxZmPanel1"); meErrxZmPanel1 = ibooker.book1D(chisto, chisto, 100, errxl, errxh); sprintf(chisto, "meErryZmPanel1"); - meErryZmPanel1 = ibooker.book1D(chisto, chisto, 100, erryl, erryh); + meErryZmPanel1 = ibooker.book1D(chisto, chisto, 100, erryl, erryh); sprintf(chisto, "meResxZmPanel1"); meResxZmPanel1 = ibooker.book1D(chisto, chisto, 100, resxl, resxh); sprintf(chisto, "meResyZmPanel1"); - meResyZmPanel1 = ibooker.book1D(chisto, chisto, 100, resyl, resyh); + meResyZmPanel1 = ibooker.book1D(chisto, chisto, 100, resyl, resyh); sprintf(chisto, "mePullxZmPanel1"); mePullxZmPanel1 = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); sprintf(chisto, "mePullyZmPanel1"); - mePullyZmPanel1 = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); + mePullyZmPanel1 = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); sprintf(chisto, "meNpixZmPanel1"); - meNpixZmPanel1 = ibooker.book1D(chisto, chisto, 100, npixl, npixh); + meNpixZmPanel1 = ibooker.book1D(chisto, chisto, 100, npixl, npixh); sprintf(chisto, "meNxpixZmPanel1"); - meNxpixZmPanel1 = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); + meNxpixZmPanel1 = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); sprintf(chisto, "meNypixZmPanel1"); - meNypixZmPanel1 = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); + meNypixZmPanel1 = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); sprintf(chisto, "meChargeZmPanel1"); - meChargeZmPanel1 = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); + meChargeZmPanel1 = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); sprintf(chisto, "meResXvsAlphaZmPanel1"); - meResXvsAlphaZmPanel1 = ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resxh, ""); + meResXvsAlphaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsAlphaZmPanel1"); - meResYvsAlphaZmPanel1 = ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resyh, ""); + meResYvsAlphaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resyh, ""); sprintf(chisto, "meResXvsBetaZmPanel1"); - meResXvsBetaZmPanel1 = ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resxh, ""); + meResXvsBetaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsBetaZmPanel1"); - meResYvsBetaZmPanel1 = ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resyh, ""); + meResYvsBetaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resyh, ""); sprintf(chisto, "mePullXvsAlphaZmPanel1"); - mePullXvsAlphaZmPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullxl, pullxh, ""); + mePullXvsAlphaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsAlphaZmPanel1"); - mePullYvsAlphaZmPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullyl, pullyh, ""); + mePullYvsAlphaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsBetaZmPanel1"); - mePullXvsBetaZmPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullxl, pullxh, ""); + mePullXvsBetaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsBetaZmPanel1"); - mePullYvsBetaZmPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullyl, pullyh, ""); + mePullYvsBetaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsPhiZmPanel1"); - mePullXvsPhiZmPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl, pullxh, ""); + mePullXvsPhiZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsPhiZmPanel1"); - mePullYvsPhiZmPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl, pullyh, ""); + mePullYvsPhiZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsEtaZmPanel1"); - mePullXvsEtaZmPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullxl, pullxh, ""); + mePullXvsEtaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsEtaZmPanel1"); - mePullYvsEtaZmPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullyl, pullyh, ""); + mePullYvsEtaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullyl, pullyh, ""); sprintf(chisto, "meWPullXvsAlphaZmPanel1"); - meWPullXvsAlphaZmPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullxl, pullxh, ""); + meWPullXvsAlphaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "meWPullYvsAlphaZmPanel1"); - meWPullYvsAlphaZmPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullyl, pullyh, ""); + meWPullYvsAlphaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "meWPullXvsBetaZmPanel1"); - meWPullXvsBetaZmPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullxl, pullxh, ""); + meWPullXvsBetaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "meWPullYvsBetaZmPanel1"); - meWPullYvsBetaZmPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullyl, pullyh, ""); + meWPullYvsBetaZmPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePosxZpPanel1"); mePosxZpPanel1 = ibooker.book1D(chisto, chisto, 100, xl, xh); @@ -826,69 +847,73 @@ void SiPixelTrackingRecHitsValid::bookHistograms(DQMStore::IBooker & ibooker,con sprintf(chisto, "meErrxZpPanel1"); meErrxZpPanel1 = ibooker.book1D(chisto, chisto, 100, errxl, errxh); sprintf(chisto, "meErryZpPanel1"); - meErryZpPanel1 = ibooker.book1D(chisto, chisto, 100, erryl, erryh); + meErryZpPanel1 = ibooker.book1D(chisto, chisto, 100, erryl, erryh); sprintf(chisto, "meResxZpPanel1"); meResxZpPanel1 = ibooker.book1D(chisto, chisto, 100, resxl, resxh); sprintf(chisto, "meResyZpPanel1"); - meResyZpPanel1 = ibooker.book1D(chisto, chisto, 100, resyl, resyh); + meResyZpPanel1 = ibooker.book1D(chisto, chisto, 100, resyl, resyh); sprintf(chisto, "mePullxZpPanel1"); mePullxZpPanel1 = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); sprintf(chisto, "mePullyZpPanel1"); - mePullyZpPanel1 = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); + mePullyZpPanel1 = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); sprintf(chisto, "meNpixZpPanel1"); - meNpixZpPanel1 = ibooker.book1D(chisto, chisto, 100, npixl, npixh); + meNpixZpPanel1 = ibooker.book1D(chisto, chisto, 100, npixl, npixh); sprintf(chisto, "meNxpixZpPanel1"); - meNxpixZpPanel1 = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); + meNxpixZpPanel1 = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); sprintf(chisto, "meNypixZpPanel1"); - meNypixZpPanel1 = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); + meNypixZpPanel1 = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); sprintf(chisto, "meChargeZpPanel1"); - meChargeZpPanel1 = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); + meChargeZpPanel1 = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); sprintf(chisto, "meResXvsAlphaZpPanel1"); - meResXvsAlphaZpPanel1 = ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resxh, ""); + meResXvsAlphaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsAlphaZpPanel1"); - meResYvsAlphaZpPanel1 = ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resyh, ""); + meResYvsAlphaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, forward_p1_alphal, forward_p1_alphah, 100, 0.0, resyh, ""); sprintf(chisto, "meResXvsBetaZpPanel1"); - meResXvsBetaZpPanel1 = ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resxh, ""); + meResXvsBetaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsBetaZpPanel1"); - meResYvsBetaZpPanel1 = ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resyh, ""); - + meResYvsBetaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resyh, ""); + sprintf(chisto, "mePullXvsAlphaZpPanel1"); - mePullXvsAlphaZpPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullxl, pullxh, ""); + mePullXvsAlphaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsAlphaZpPanel1"); - mePullYvsAlphaZpPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullyl, pullyh, ""); + mePullYvsAlphaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsBetaZpPanel1"); - mePullXvsBetaZpPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullxl, pullxh, ""); + mePullXvsBetaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsBetaZpPanel1"); - mePullYvsBetaZpPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullyl, pullyh, ""); + mePullYvsBetaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsPhiZpPanel1"); - mePullXvsPhiZpPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl, pullxh, ""); + mePullXvsPhiZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsPhiZpPanel1"); - mePullYvsPhiZpPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl, pullyh, ""); + mePullYvsPhiZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsEtaZpPanel1"); - mePullXvsEtaZpPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullxl, pullxh, ""); + mePullXvsEtaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsEtaZpPanel1"); - mePullYvsEtaZpPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullyl, pullyh, ""); - + mePullYvsEtaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullyl, pullyh, ""); + sprintf(chisto, "meWPullXvsAlphaZpPanel1"); - meWPullXvsAlphaZpPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullxl, pullxh, ""); + meWPullXvsAlphaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "meWPullYvsAlphaZpPanel1"); - meWPullYvsAlphaZpPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullyl, pullyh, ""); + meWPullYvsAlphaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p1_alphal, pull_forward_p1_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "meWPullXvsBetaZpPanel1"); - meWPullXvsBetaZpPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullxl, pullxh, ""); + meWPullXvsBetaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "meWPullYvsBetaZpPanel1"); - meWPullYvsBetaZpPanel1 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullyl, pullyh, ""); + meWPullYvsBetaZpPanel1 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePosxZmPanel2"); mePosxZmPanel2 = ibooker.book1D(chisto, chisto, 100, xl, xh); @@ -897,70 +922,73 @@ void SiPixelTrackingRecHitsValid::bookHistograms(DQMStore::IBooker & ibooker,con sprintf(chisto, "meErrxZmPanel2"); meErrxZmPanel2 = ibooker.book1D(chisto, chisto, 100, errxl, errxh); sprintf(chisto, "meErryZmPanel2"); - meErryZmPanel2 = ibooker.book1D(chisto, chisto, 100, erryl, erryh); + meErryZmPanel2 = ibooker.book1D(chisto, chisto, 100, erryl, erryh); sprintf(chisto, "meResxZmPanel2"); meResxZmPanel2 = ibooker.book1D(chisto, chisto, 100, resxl, resxh); sprintf(chisto, "meResyZmPanel2"); - meResyZmPanel2 = ibooker.book1D(chisto, chisto, 100, resyl, resyh); + meResyZmPanel2 = ibooker.book1D(chisto, chisto, 100, resyl, resyh); sprintf(chisto, "mePullxZmPanel2"); mePullxZmPanel2 = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); sprintf(chisto, "mePullyZmPanel2"); - mePullyZmPanel2 = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); + mePullyZmPanel2 = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); sprintf(chisto, "meNpixZmPanel2"); - meNpixZmPanel2 = ibooker.book1D(chisto, chisto, 100, npixl, npixh); + meNpixZmPanel2 = ibooker.book1D(chisto, chisto, 100, npixl, npixh); sprintf(chisto, "meNxpixZmPanel2"); - meNxpixZmPanel2 = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); + meNxpixZmPanel2 = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); sprintf(chisto, "meNypixZmPanel2"); - meNypixZmPanel2 = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); + meNypixZmPanel2 = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); sprintf(chisto, "meChargeZmPanel2"); - meChargeZmPanel2 = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); + meChargeZmPanel2 = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); sprintf(chisto, "meResXvsAlphaZmPanel2"); - meResXvsAlphaZmPanel2 = ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resxh, ""); + meResXvsAlphaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsAlphaZmPanel2"); - meResYvsAlphaZmPanel2 = ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resyh, ""); + meResYvsAlphaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resyh, ""); sprintf(chisto, "meResXvsBetaZmPanel2"); - meResXvsBetaZmPanel2 = ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resxh, ""); + meResXvsBetaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsBetaZmPanel2"); - meResYvsBetaZmPanel2 = ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resyh, ""); - + meResYvsBetaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, forward_neg_betal, forward_neg_betah, 100, 0.0, resyh, ""); + sprintf(chisto, "mePullXvsAlphaZmPanel2"); - mePullXvsAlphaZmPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullxl, pullxh, ""); + mePullXvsAlphaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsAlphaZmPanel2"); - mePullYvsAlphaZmPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullyl, pullyh, ""); + mePullYvsAlphaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsBetaZmPanel2"); - mePullXvsBetaZmPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullxl, pullxh, ""); + mePullXvsBetaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsBetaZmPanel2"); - mePullYvsBetaZmPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullyl, pullyh, ""); + mePullYvsBetaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsPhiZmPanel2"); - mePullXvsPhiZmPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl, pullxh, ""); + mePullXvsPhiZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsPhiZmPanel2"); - mePullYvsPhiZmPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl, pullyh, ""); + mePullYvsPhiZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsEtaZmPanel2"); - mePullXvsEtaZmPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullxl, pullxh, ""); + mePullXvsEtaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsEtaZmPanel2"); - mePullYvsEtaZmPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullyl, pullyh, ""); + mePullYvsEtaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_etal, pull_forward_neg_etah, 100, pullyl, pullyh, ""); sprintf(chisto, "meWPullXvsAlphaZmPanel2"); - meWPullXvsAlphaZmPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullxl, pullxh, ""); + meWPullXvsAlphaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "meWPullYvsAlphaZmPanel2"); - meWPullYvsAlphaZmPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullyl, pullyh, ""); + meWPullYvsAlphaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "meWPullXvsBetaZmPanel2"); - meWPullXvsBetaZmPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullxl, pullxh, ""); + meWPullXvsBetaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "meWPullYvsBetaZmPanel2"); - meWPullYvsBetaZmPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullyl, pullyh, ""); - + meWPullYvsBetaZmPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_neg_betal, pull_forward_neg_betah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePosxZpPanel2"); mePosxZpPanel2 = ibooker.book1D(chisto, chisto, 100, xl, xh); @@ -969,74 +997,78 @@ void SiPixelTrackingRecHitsValid::bookHistograms(DQMStore::IBooker & ibooker,con sprintf(chisto, "meErrxZpPanel2"); meErrxZpPanel2 = ibooker.book1D(chisto, chisto, 100, errxl, errxh); sprintf(chisto, "meErryZpPanel2"); - meErryZpPanel2 = ibooker.book1D(chisto, chisto, 100, erryl, erryh); + meErryZpPanel2 = ibooker.book1D(chisto, chisto, 100, erryl, erryh); sprintf(chisto, "meResxZpPanel2"); meResxZpPanel2 = ibooker.book1D(chisto, chisto, 100, resxl, resxh); sprintf(chisto, "meResyZpPanel2"); - meResyZpPanel2 = ibooker.book1D(chisto, chisto, 100, resyl, resyh); + meResyZpPanel2 = ibooker.book1D(chisto, chisto, 100, resyl, resyh); sprintf(chisto, "mePullxZpPanel2"); mePullxZpPanel2 = ibooker.book1D(chisto, chisto, 100, pullxl, pullxh); sprintf(chisto, "mePullyZpPanel2"); - mePullyZpPanel2 = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); + mePullyZpPanel2 = ibooker.book1D(chisto, chisto, 100, pullyl, pullyh); sprintf(chisto, "meNpixZpPanel2"); - meNpixZpPanel2 = ibooker.book1D(chisto, chisto, 100, npixl, npixh); + meNpixZpPanel2 = ibooker.book1D(chisto, chisto, 100, npixl, npixh); sprintf(chisto, "meNxpixZpPanel2"); - meNxpixZpPanel2 = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); + meNxpixZpPanel2 = ibooker.book1D(chisto, chisto, 100, nxpixl, nxpixh); sprintf(chisto, "meNypixZpPanel2"); - meNypixZpPanel2 = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); + meNypixZpPanel2 = ibooker.book1D(chisto, chisto, 100, nypixl, nypixh); sprintf(chisto, "meChargeZpPanel2"); - meChargeZpPanel2 = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); + meChargeZpPanel2 = ibooker.book1D(chisto, chisto, 100, forward_chargel, forward_chargeh); sprintf(chisto, "meResXvsAlphaZpPanel2"); - meResXvsAlphaZpPanel2 = ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resxh, ""); + meResXvsAlphaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsAlphaZpPanel2"); - meResYvsAlphaZpPanel2 = ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resyh, ""); + meResYvsAlphaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, forward_p2_alphal, forward_p2_alphah, 100, 0.0, resyh, ""); sprintf(chisto, "meResXvsBetaZpPanel2"); - meResXvsBetaZpPanel2 = ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resxh, ""); + meResXvsBetaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resxh, ""); sprintf(chisto, "meResYvsBetaZpPanel2"); - meResYvsBetaZpPanel2 = ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resyh, ""); - + meResYvsBetaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, forward_pos_betal, forward_pos_betah, 100, 0.0, resyh, ""); + sprintf(chisto, "mePullXvsAlphaZpPanel2"); - mePullXvsAlphaZpPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullxl, pullxh, ""); + mePullXvsAlphaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsAlphaZpPanel2"); - mePullYvsAlphaZpPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullyl, pullyh, ""); + mePullYvsAlphaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsBetaZpPanel2"); - mePullXvsBetaZpPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullxl, pullxh, ""); + mePullXvsBetaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsBetaZpPanel2"); - mePullYvsBetaZpPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullyl, pullyh, ""); + mePullYvsBetaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsPhiZpPanel2"); - mePullXvsPhiZpPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl, pullxh, ""); + mePullXvsPhiZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsPhiZpPanel2"); - mePullYvsPhiZpPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl, pullyh, ""); + mePullYvsPhiZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_phil, pull_forward_phih, 100, pullyl, pullyh, ""); sprintf(chisto, "mePullXvsEtaZpPanel2"); - mePullXvsEtaZpPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullxl, pullxh, ""); + mePullXvsEtaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullxl, pullxh, ""); sprintf(chisto, "mePullYvsEtaZpPanel2"); - mePullYvsEtaZpPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullyl, pullyh, ""); + mePullYvsEtaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_etal, pull_forward_pos_etah, 100, pullyl, pullyh, ""); sprintf(chisto, "meWPullXvsAlphaZpPanel2"); - meWPullXvsAlphaZpPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullxl, pullxh, ""); + meWPullXvsAlphaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullxl, pullxh, ""); sprintf(chisto, "meWPullYvsAlphaZpPanel2"); - meWPullYvsAlphaZpPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullyl, pullyh, ""); + meWPullYvsAlphaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_p2_alphal, pull_forward_p2_alphah, 100, pullyl, pullyh, ""); sprintf(chisto, "meWPullXvsBetaZpPanel2"); - meWPullXvsBetaZpPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullxl, pullxh, ""); + meWPullXvsBetaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullxl, pullxh, ""); sprintf(chisto, "meWPullYvsBetaZpPanel2"); - meWPullYvsBetaZpPanel2 - = ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullyl, pullyh, ""); + meWPullYvsBetaZpPanel2 = + ibooker.bookProfile(chisto, chisto, 20, pull_forward_pos_betal, pull_forward_pos_betah, 100, pullyl, pullyh, ""); - // all hits (not only from tracks) + // all hits (not only from tracks) sprintf(chisto, "mePosxBarrel_all_hits"); mePosxBarrel_all_hits = ibooker.book1D(chisto, chisto, 100, xl, xh); - sprintf(chisto, "mePosyBarrel_all_hits"); + sprintf(chisto, "mePosyBarrel_all_hits"); mePosyBarrel_all_hits = ibooker.book1D(chisto, chisto, 100, yl, yh); sprintf(chisto, "mePosxZmPanel1_all_hits"); @@ -1058,35 +1090,32 @@ void SiPixelTrackingRecHitsValid::bookHistograms(DQMStore::IBooker & ibooker,con mePosyZpPanel2_all_hits = ibooker.book1D(chisto, chisto, 100, yl, yh); // control histograms - meTracksPerEvent = ibooker.book1D("meTracksPerEvent" , "meTracksPerEvent" , 200, 0.0, 200.0); - mePixRecHitsPerTrack = ibooker.book1D("mePixRecHitsPerTrack", "mePixRecHitsPerTrack", 6, 0.0, 6.0); - + meTracksPerEvent = ibooker.book1D("meTracksPerEvent", "meTracksPerEvent", 200, 0.0, 200.0); + mePixRecHitsPerTrack = ibooker.book1D("mePixRecHitsPerTrack", "mePixRecHitsPerTrack", 6, 0.0, 6.0); } // Virtual destructor needed. -SiPixelTrackingRecHitsValid::~SiPixelTrackingRecHitsValid() -{ +SiPixelTrackingRecHitsValid::~SiPixelTrackingRecHitsValid() { //save local root file only in standalone mode - if ( runStandalone && !outputFile_.empty() && dbe_ ) dbe_->save(outputFile_); -} + if (runStandalone && !outputFile_.empty() && dbe_) + dbe_->save(outputFile_); +} // Functions that gets called by framework every event -void SiPixelTrackingRecHitsValid::analyze(const edm::Event& e, const edm::EventSetup& es) -{ +void SiPixelTrackingRecHitsValid::analyze(const edm::Event& e, const edm::EventSetup& es) { //Retrieve tracker topology from geometry edm::ESHandle tTopo; es.get().get(tTopo); - run = e.id().run(); evt = e.id().event(); - // if ( evt%1000 == 0 ) - //cout << "evt = " << evt << endl; - + // if ( evt%1000 == 0 ) + //cout << "evt = " << evt << endl; + float math_pi = 3.14159265; float radtodeg = 180.0 / math_pi; - + DetId detId; LocalPoint position; @@ -1094,678 +1123,643 @@ void SiPixelTrackingRecHitsValid::analyze(const edm::Event& e, const edm::EventS float mindist = 999999.9; std::vector matched; - TrackerHitAssociator associate(e, trackerHitAssociatorConfig_); + TrackerHitAssociator associate(e, trackerHitAssociatorConfig_); edm::ESHandle pDD; - es.get ().get (pDD); - const TrackerGeometry* tracker = &(* pDD); - - if ( !MTCCtrack_ ) - { - // --------------------------------------- all hits ----------------------------------------------------------- - //--- Fetch Pixel RecHits - edm::Handle recHitColl; - e.getByToken( siPixelRecHitCollectionToken_, recHitColl ); - - //cout <<" ----- Found " - // << const_cast(recHitColl.product())->size() - // << " Pixel RecHits" << std::endl; - - //-----Iterate over detunits - for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++) - { - DetId detId = ((*it)->geographicalId()); - - unsigned int subid = detId.subdetId(); - if ( !((subid==1) || (subid==2)) ) - continue; // end subid if - - SiPixelRecHitCollection::const_iterator match = recHitColl->find(detId); - if (match == recHitColl->end()) continue; - - SiPixelRecHitCollection::DetSet pixelrechitRange = *match; - SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorBegin = pixelrechitRange.begin(); - SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorEnd = pixelrechitRange.end(); - SiPixelRecHitCollection::DetSet::const_iterator pixeliter = pixelrechitRangeIteratorBegin; - std::vector matched; - - //----Loop over rechits for this detId - for ( ; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) - { - LocalPoint lp = pixeliter->localPosition(); - float rechitx = lp.x(); - float rechity = lp.y(); - - detId = (*it)->geographicalId(); - subdetId = (int)detId.subdetId(); - if ( (int)detId.subdetId() == (int)PixelSubdetector::PixelBarrel ) - { - mePosxBarrel_all_hits->Fill( rechitx ); - mePosyBarrel_all_hits->Fill( rechity ); - } - else if ( (int)detId.subdetId() == (int)PixelSubdetector::PixelEndcap ) - { - - side = tTopo->pxfSide(detId); - disk = tTopo->pxfDisk(detId); - blade = tTopo->pxfBlade(detId); - panel = tTopo->pxfPanel(detId); - plaq = tTopo->pxfModule(detId); // also known as plaquette - - if ( side==1 ) - { - if ( panel==1 ) - { - mePosxZmPanel1_all_hits->Fill( rechitx ); - mePosyZmPanel1_all_hits->Fill( rechity ); - } - else if ( panel==2 ) - { - mePosxZmPanel2_all_hits->Fill( rechitx ); - mePosyZmPanel2_all_hits->Fill( rechity ); - } - else edm::LogWarning("SiPixelTrackingRecHitsValid") << "..............................................Wrong panel number !"; - } // if ( side==1 ) - else if ( side==2 ) - { - if ( panel==1 ) - { - mePosxZpPanel1_all_hits->Fill( rechitx ); - mePosyZpPanel1_all_hits->Fill( rechity ); - } - else if ( panel==2 ) - { - mePosxZpPanel2_all_hits->Fill( rechitx ); - mePosyZpPanel2_all_hits->Fill( rechity ); - } - else edm::LogWarning("SiPixelTrackingRecHitsValid")<< "..............................................Wrong panel number !"; - } //else if ( side==2 ) - else edm::LogWarning("SiPixelTrackingRecHitsValid") << ".......................................................Wrong side !" ; - - } // else if ( detId.subdetId()==PixelSubdetector::PixelEndcap ) - else edm::LogWarning("SiPixelTrackingRecHitsValid") << "Pixel rechit collection but we are not in the pixel detector" << (int)detId.subdetId() ; - - } - } - // ------------------------------------------------ all hits --------------------------------------------------------------- - - // Get tracks - edm::Handle trackCollection; - e.getByToken( recoTrackCollectionToken_, trackCollection ); - const reco::TrackCollection *tracks = trackCollection.product(); - reco::TrackCollection::const_iterator tciter; - - int n_tracks = (int)tracks->size(); // number of tracks in this event - meTracksPerEvent->Fill( n_tracks ); - - if ( !tracks->empty() ) - { - // Loop on tracks - for ( tciter=tracks->begin(); tciter!=tracks->end(); tciter++) - { - phi = tciter->momentum().phi() / math_pi*180.0; - eta = tciter->momentum().eta(); - - int n_hits = 0; - // First loop on hits: find matched hits - for ( trackingRecHit_iterator it = tciter->recHitsBegin(); it != tciter->recHitsEnd(); it++) - { - const TrackingRecHit &thit = **it; - // Is it a matched hit? - const SiPixelRecHit* matchedhit = dynamic_cast(&thit); - - if ( matchedhit ) - { - ++n_hits; - - layer = -9999; - ladder = -9999; - mod = -9999; - side = -9999; - disk = -9999; - blade = -9999; - panel = -9999; - plaq = -9999; - - rechitx = -9999.9; - rechity = -9999.9; - rechitz = -9999.9; - rechiterrx = -9999.9; - rechiterry = -9999.9; - rechitresx = -9999.9; - rechitresy = -9999.9; - rechitpullx = -9999.9; - rechitpully = -9999.9; - - npix = -9999; - nxpix = -9999; - nypix = -9999; - charge = -9999.9; - - alpha = -9999.9; - beta = -9999.9; - - half = -9999; - flipped = -9999; - - nsimhit = -9999; - - simhitx = -9999.9; - simhity = -9999.9; - - position = (*it)->localPosition(); - error = (*it)->localPositionError(); - - rechitx = position.x(); - rechity = position.y(); - rechitz = position.z(); - rechiterrx = sqrt(error.xx()); - rechiterry = sqrt(error.yy()); - - npix = (*matchedhit).cluster()->size(); - nxpix = (*matchedhit).cluster()->sizeX(); - nypix = (*matchedhit).cluster()->sizeY(); - charge = (*matchedhit).cluster()->charge(); - - //Association of the rechit to the simhit - matched.clear(); - matched = associate.associateHit(*matchedhit); - - nsimhit = (int)matched.size(); - - if ( !matched.empty() ) - { - mindist = 999999.9; - float distx, disty, dist; - bool found_hit_from_generated_particle = false; - - int n_assoc_muon = 0; - - std::vector::const_iterator closestit = matched.begin(); - for (std::vector::const_iterator m=matched.begin(); m::const_iterator m=matched.begin(); m 1 ) - { - edm::LogWarning("SiPixelTrackingRecHitsValid") << " ----- This is not good: n_assoc_muon = " << n_assoc_muon ; - edm::LogWarning("SiPixelTrackingRecHitsValid") << "evt = " << evt ; - } - - pidhit = (*closestit).particleType(); - - simhitx = 0.5*( (*closestit).entryPoint().x() + (*closestit).exitPoint().x() ); - simhity = 0.5*( (*closestit).entryPoint().y() + (*closestit).exitPoint().y() ); - - rechitresx = rechitx - simhitx; - rechitresy = rechity - simhity; - rechitpullx = ( rechitx - simhitx ) / sqrt(error.xx()); - rechitpully = ( rechity - simhity ) / sqrt(error.yy()); - - float simhitpx = (*closestit).momentumAtEntry().x(); - float simhitpy = (*closestit).momentumAtEntry().y(); - float simhitpz = (*closestit).momentumAtEntry().z(); - - //beta = atan2(simhitpz, simhitpy) * radtodeg; - //alpha = atan2(simhitpz, simhitpx) * radtodeg; - - beta = fabs(atan2(simhitpz, simhitpy)) * radtodeg; - alpha = fabs(atan2(simhitpz, simhitpx)) * radtodeg; - - detId = (*it)->geographicalId(); - - subdetId = (int)detId.subdetId(); - - if ( (int)detId.subdetId() == (int)PixelSubdetector::PixelBarrel ) - { - mePosxBarrel->Fill( rechitx ); - mePosyBarrel->Fill( rechity ); - meErrxBarrel->Fill( rechiterrx ); - meErryBarrel->Fill( rechiterry ); - meResxBarrel->Fill( rechitresx ); - meResyBarrel->Fill( rechitresy ); - mePullxBarrel->Fill( rechitpullx ); - mePullyBarrel->Fill( rechitpully ); - meNpixBarrel->Fill( npix ); - meNxpixBarrel->Fill( nxpix ); - meNypixBarrel->Fill( nypix ); - meChargeBarrel->Fill( charge ); - meResXvsAlphaBarrel->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaBarrel->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaBarrel->Fill( beta, fabs(rechitresx) ); - meResYvsBetaBarrel->Fill( beta, fabs(rechitresy) ); - mePullXvsAlphaBarrel->Fill( alpha, rechitpullx ); - mePullYvsAlphaBarrel->Fill( alpha, rechitpully ); - mePullXvsBetaBarrel->Fill( beta, rechitpullx ); - mePullYvsBetaBarrel->Fill( beta, rechitpully ); - mePullXvsPhiBarrel->Fill( phi, rechitpullx ); - mePullYvsPhiBarrel->Fill( phi, rechitpully ); - mePullXvsEtaBarrel->Fill( eta, rechitpullx ); - mePullYvsEtaBarrel->Fill( eta, rechitpully ); - - const PixelGeomDetUnit * theGeomDet - = dynamic_cast ( tracker->idToDet(detId) ); - //const PixelTopology * topol = (&(theGeomDet->specificTopology())); - - int tmp_nrows = theGeomDet->specificTopology().nrows(); - - if ( tmp_nrows == 80 ) - { - mePosxBarrelHalfModule->Fill( rechitx ); - mePosyBarrelHalfModule->Fill( rechity ); - half = 1; - } - else if ( tmp_nrows == 160 ) - { - mePosxBarrelFullModule->Fill( rechitx ); - mePosyBarrelFullModule->Fill( rechity ); - half = 0; - } - else - edm::LogWarning("SiPixelTrackingRecHitsValid") << "-------------------------------------------------- Wrong module size !!!"; - - float tmp1 = theGeomDet->surface().toGlobal(Local3DPoint(0.,0.,0.)).perp(); - float tmp2 = theGeomDet->surface().toGlobal(Local3DPoint(0.,0.,1.)).perp(); - - if ( tmp2Fill( rechitx ); - mePosyBarrelFlippedLadders->Fill( rechity ); - flipped = 1; - - meResXvsAlphaBarrelFlippedLadders->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaBarrelFlippedLadders->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaBarrelFlippedLadders->Fill( beta, fabs(rechitresx) ); - meResYvsBetaBarrelFlippedLadders->Fill( beta, fabs(rechitresy) ); - mePullXvsAlphaBarrelFlippedLadders->Fill( alpha, rechitpullx ); - mePullYvsAlphaBarrelFlippedLadders->Fill( alpha, rechitpully ); - mePullXvsBetaBarrelFlippedLadders->Fill( beta, rechitpullx ); - mePullYvsBetaBarrelFlippedLadders->Fill( beta, rechitpully ); - mePullXvsPhiBarrelFlippedLadders->Fill( phi, rechitpullx ); - mePullYvsPhiBarrelFlippedLadders->Fill( phi, rechitpully ); - mePullXvsEtaBarrelFlippedLadders->Fill( eta, rechitpullx ); - mePullYvsEtaBarrelFlippedLadders->Fill( eta, rechitpully ); - - meWPullXvsAlphaBarrelFlippedLadders->Fill( alpha, fabs(rechitpullx) ); - meWPullYvsAlphaBarrelFlippedLadders->Fill( alpha, fabs(rechitpully) ); - meWPullXvsBetaBarrelFlippedLadders->Fill( beta, fabs(rechitpullx) ); - meWPullYvsBetaBarrelFlippedLadders->Fill( beta, fabs(rechitpully) ); - } - else - { // not flipped - mePosxBarrelNonFlippedLadders->Fill( rechitx ); - mePosyBarrelNonFlippedLadders->Fill( rechity ); - flipped = 0; - - meResXvsAlphaBarrelNonFlippedLadders->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaBarrelNonFlippedLadders->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaBarrelNonFlippedLadders->Fill( beta, fabs(rechitresx) ); - meResYvsBetaBarrelNonFlippedLadders->Fill( beta, fabs(rechitresy) ); - mePullXvsAlphaBarrelNonFlippedLadders->Fill( alpha, rechitpullx ); - mePullYvsAlphaBarrelNonFlippedLadders->Fill( alpha, rechitpully ); - mePullXvsBetaBarrelNonFlippedLadders->Fill( beta, rechitpullx ); - mePullYvsBetaBarrelNonFlippedLadders->Fill( beta, rechitpully ); - mePullXvsPhiBarrelNonFlippedLadders->Fill( phi, rechitpullx ); - mePullYvsPhiBarrelNonFlippedLadders->Fill( phi, rechitpully ); - mePullXvsEtaBarrelNonFlippedLadders->Fill( eta, rechitpullx ); - mePullYvsEtaBarrelNonFlippedLadders->Fill( eta, rechitpully ); - - meWPullXvsAlphaBarrelNonFlippedLadders->Fill( alpha, fabs(rechitpullx) ); - meWPullYvsAlphaBarrelNonFlippedLadders->Fill( alpha, fabs(rechitpully) ); - meWPullXvsBetaBarrelNonFlippedLadders->Fill( beta, fabs(rechitpullx) ); - meWPullYvsBetaBarrelNonFlippedLadders->Fill( beta, fabs(rechitpully) ); - } - - - layer = tTopo->pxbLayer(detId); // Layer: 1,2,3. - ladder = tTopo->pxbLadder(detId); // Ladder: 1-20, 32, 44. - mod = tTopo->pxbModule(detId); // Mod: 1-8. - - mePosxBarrelLayerModule[layer-1][mod-1]->Fill( rechitx ); - mePosyBarrelLayerModule[layer-1][mod-1]->Fill( rechity ); - meErrxBarrelLayerModule[layer-1][mod-1]->Fill( rechiterrx ); - meErryBarrelLayerModule[layer-1][mod-1]->Fill( rechiterry ); - meResxBarrelLayerModule[layer-1][mod-1]->Fill( rechitresx ); - meResyBarrelLayerModule[layer-1][mod-1]->Fill( rechitresy ); - mePullxBarrelLayerModule[layer-1][mod-1]->Fill( rechitpullx ); - mePullyBarrelLayerModule[layer-1][mod-1]->Fill( rechitpully ); - meNpixBarrelLayerModule[layer-1][mod-1]->Fill( npix ); - meNxpixBarrelLayerModule[layer-1][mod-1]->Fill( nxpix ); - meNypixBarrelLayerModule[layer-1][mod-1]->Fill( nypix ); - meChargeBarrelLayerModule[layer-1][mod-1]->Fill( charge ); - meResXvsAlphaBarrelLayerModule[layer-1][mod-1]->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaBarrelLayerModule[layer-1][mod-1]->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaBarrelLayerModule[layer-1][mod-1]->Fill( beta, fabs(rechitresx) ); - meResYvsBetaBarrelLayerModule[layer-1][mod-1]->Fill( beta, fabs(rechitresy) ); - mePullXvsAlphaBarrelLayerModule[layer-1][mod-1]->Fill( alpha, rechitpullx ); - mePullYvsAlphaBarrelLayerModule[layer-1][mod-1]->Fill( alpha, rechitpully ); - mePullXvsBetaBarrelLayerModule[layer-1][mod-1]->Fill( beta, rechitpullx ); - mePullYvsBetaBarrelLayerModule[layer-1][mod-1]->Fill( beta, rechitpully ); - mePullXvsPhiBarrelLayerModule[layer-1][mod-1]->Fill( phi, rechitpullx ); - mePullYvsPhiBarrelLayerModule[layer-1][mod-1]->Fill( phi, rechitpully ); - mePullXvsEtaBarrelLayerModule[layer-1][mod-1]->Fill( eta, rechitpullx ); - mePullYvsEtaBarrelLayerModule[layer-1][mod-1]->Fill( eta, rechitpully ); - - meResxBarrelLayer[layer-1]->Fill( rechitresx ); - meResyBarrelLayer[layer-1]->Fill( rechitresy ); - mePullxBarrelLayer[layer-1]->Fill( rechitpullx ); - mePullyBarrelLayer[layer-1]->Fill( rechitpully ); - - if ( tmp2Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaBarrelFlippedLaddersLayer[layer-1]->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaBarrelFlippedLaddersLayer[layer-1]->Fill( beta, fabs(rechitresx) ); - meResYvsBetaBarrelFlippedLaddersLayer[layer-1]->Fill( beta, fabs(rechitresy) ); - } - else - { // not flipped - meResXvsAlphaBarrelNonFlippedLaddersLayer[layer-1]->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaBarrelNonFlippedLaddersLayer[layer-1]->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaBarrelNonFlippedLaddersLayer[layer-1]->Fill( beta, fabs(rechitresx) ); - meResYvsBetaBarrelNonFlippedLaddersLayer[layer-1]->Fill( beta, fabs(rechitresy) ); - } - - } - else if ( (int)detId.subdetId() == (int)PixelSubdetector::PixelEndcap ) - { - - side = tTopo->pxfSide(detId); - disk = tTopo->pxfDisk(detId); - blade = tTopo->pxfBlade(detId); - panel = tTopo->pxfPanel(detId); - plaq = tTopo->pxfModule(detId); // also known as plaquette - - if ( side==1 ) - { - if ( panel==1 ) - { - mePosxZmPanel1->Fill( rechitx ); - mePosyZmPanel1->Fill( rechity ); - meErrxZmPanel1->Fill( rechiterrx ); - meErryZmPanel1->Fill( rechiterry ); - meResxZmPanel1->Fill( rechitresx ); - meResyZmPanel1->Fill( rechitresy ); - mePullxZmPanel1->Fill( rechitpullx ); - mePullyZmPanel1->Fill( rechitpully ); - meNpixZmPanel1->Fill( npix ); - meNxpixZmPanel1->Fill( nxpix ); - meNypixZmPanel1->Fill( nypix ); - meChargeZmPanel1->Fill( charge ); - meResXvsAlphaZmPanel1->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaZmPanel1->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaZmPanel1->Fill( beta, fabs(rechitresx) ); - meResYvsBetaZmPanel1->Fill( beta, fabs(rechitresy) ); - mePullXvsAlphaZmPanel1->Fill( alpha, rechitpullx ); - mePullYvsAlphaZmPanel1->Fill( alpha, rechitpully ); - mePullXvsBetaZmPanel1->Fill( beta, rechitpullx ); - mePullYvsBetaZmPanel1->Fill( beta, rechitpully ); - mePullXvsPhiZmPanel1->Fill( phi, rechitpullx ); - mePullYvsPhiZmPanel1->Fill( phi, rechitpully ); - mePullXvsEtaZmPanel1->Fill( eta, rechitpullx ); - mePullYvsEtaZmPanel1->Fill( eta, rechitpully ); - - meWPullXvsAlphaZmPanel1->Fill( alpha, fabs(rechitpullx) ); - meWPullYvsAlphaZmPanel1->Fill( alpha, fabs(rechitpully) ); - meWPullXvsBetaZmPanel1->Fill( beta, fabs(rechitpullx) ); - meWPullYvsBetaZmPanel1->Fill( beta, fabs(rechitpully) ); - - mePosxZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechitx ); - mePosyZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechity ); - meErrxZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechiterrx ); - meErryZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechiterry ); - meResxZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechitresx ); - meResyZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechitresy ); - mePullxZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechitpullx ); - mePullyZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechitpully ); - meNpixZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( npix ); - meNxpixZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( nxpix ); - meNypixZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( nypix ); - meChargeZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( charge ); - meResXvsAlphaZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( beta, fabs(rechitresx) ); - meResYvsBetaZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( beta, fabs(rechitresy) ); - mePullXvsAlphaZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( alpha, rechitpullx ); - mePullYvsAlphaZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( alpha, rechitpully ); - mePullXvsBetaZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( beta, rechitpullx ); - mePullYvsBetaZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( beta, rechitpully ); - mePullXvsPhiZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( phi, rechitpullx ); - mePullYvsPhiZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( phi, rechitpully ); - mePullXvsEtaZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( eta, rechitpullx ); - mePullYvsEtaZmPanel1DiskPlaq[disk-1][plaq-1]->Fill( eta, rechitpully ); - - } - else if ( panel==2 ) - { - mePosxZmPanel2->Fill( rechitx ); - mePosyZmPanel2->Fill( rechity ); - meErrxZmPanel2->Fill( rechiterrx ); - meErryZmPanel2->Fill( rechiterry ); - meResxZmPanel2->Fill( rechitresx ); - meResyZmPanel2->Fill( rechitresy ); - mePullxZmPanel2->Fill( rechitpullx ); - mePullyZmPanel2->Fill( rechitpully ); - meNpixZmPanel2->Fill( npix ); - meNxpixZmPanel2->Fill( nxpix ); - meNypixZmPanel2->Fill( nypix ); - meChargeZmPanel2->Fill( charge ); - meResXvsAlphaZmPanel2->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaZmPanel2->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaZmPanel2->Fill( beta, fabs(rechitresx) ); - meResYvsBetaZmPanel2->Fill( beta, fabs(rechitresy) ); - mePullXvsAlphaZmPanel2->Fill( alpha, rechitpullx ); - mePullYvsAlphaZmPanel2->Fill( alpha, rechitpully ); - mePullXvsBetaZmPanel2->Fill( beta, rechitpullx ); - mePullYvsBetaZmPanel2->Fill( beta, rechitpully ); - mePullXvsPhiZmPanel2->Fill( phi, rechitpullx ); - mePullYvsPhiZmPanel2->Fill( phi, rechitpully ); - mePullXvsEtaZmPanel2->Fill( eta, rechitpullx ); - mePullYvsEtaZmPanel2->Fill( eta, rechitpully ); - - meWPullXvsAlphaZmPanel2->Fill( alpha, fabs(rechitpullx) ); - meWPullYvsAlphaZmPanel2->Fill( alpha, fabs(rechitpully) ); - meWPullXvsBetaZmPanel2->Fill( beta, fabs(rechitpullx) ); - meWPullYvsBetaZmPanel2->Fill( beta, fabs(rechitpully) ); - - mePosxZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechitx ); - mePosyZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechity ); - meErrxZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechiterrx ); - meErryZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechiterry ); - meResxZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechitresx ); - meResyZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechitresy ); - mePullxZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechitpullx ); - mePullyZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechitpully ); - meNpixZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( npix ); - meNxpixZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( nxpix ); - meNypixZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( nypix ); - meChargeZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( charge ); - meResXvsAlphaZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( beta, fabs(rechitresx) ); - meResYvsBetaZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( beta, fabs(rechitresy) ); - mePullXvsAlphaZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( alpha, rechitpullx ); - mePullYvsAlphaZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( alpha, rechitpully ); - mePullXvsBetaZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( beta, rechitpullx ); - mePullYvsBetaZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( beta, rechitpully ); - mePullXvsPhiZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( phi, rechitpullx ); - mePullYvsPhiZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( phi, rechitpully ); - mePullXvsEtaZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( eta, rechitpullx ); - mePullYvsEtaZmPanel2DiskPlaq[disk-1][plaq-1]->Fill( eta, rechitpully ); - - } - else edm::LogWarning("SiPixelTrackingRecHitsValid") << "..............................................Wrong panel number !"; - } // if ( side==1 ) - else if ( side==2 ) - { - if ( panel==1 ) - { - mePosxZpPanel1->Fill( rechitx ); - mePosyZpPanel1->Fill( rechity ); - meErrxZpPanel1->Fill( rechiterrx ); - meErryZpPanel1->Fill( rechiterry ); - meResxZpPanel1->Fill( rechitresx ); - meResyZpPanel1->Fill( rechitresy ); - mePullxZpPanel1->Fill( rechitpullx ); - mePullyZpPanel1->Fill( rechitpully ); - meNpixZpPanel1->Fill( npix ); - meNxpixZpPanel1->Fill( nxpix ); - meNypixZpPanel1->Fill( nypix ); - meChargeZpPanel1->Fill( charge ); - meResXvsAlphaZpPanel1->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaZpPanel1->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaZpPanel1->Fill( beta, fabs(rechitresx) ); - meResYvsBetaZpPanel1->Fill( beta, fabs(rechitresy) ); - mePullXvsAlphaZpPanel1->Fill( alpha, rechitpullx ); - mePullYvsAlphaZpPanel1->Fill( alpha, rechitpully ); - mePullXvsBetaZpPanel1->Fill( beta, rechitpullx ); - mePullYvsBetaZpPanel1->Fill( beta, rechitpully ); - mePullXvsPhiZpPanel1->Fill( phi, rechitpullx ); - mePullYvsPhiZpPanel1->Fill( phi, rechitpully ); - mePullXvsEtaZpPanel1->Fill( eta, rechitpullx ); - mePullYvsEtaZpPanel1->Fill( eta, rechitpully ); - - meWPullXvsAlphaZpPanel1->Fill( alpha, fabs(rechitpullx) ); - meWPullYvsAlphaZpPanel1->Fill( alpha, fabs(rechitpully) ); - meWPullXvsBetaZpPanel1->Fill( beta, fabs(rechitpullx) ); - meWPullYvsBetaZpPanel1->Fill( beta, fabs(rechitpully) ); - - mePosxZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechitx ); - mePosyZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechity ); - meErrxZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechiterrx ); - meErryZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechiterry ); - meResxZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechitresx ); - meResyZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechitresy ); - mePullxZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechitpullx ); - mePullyZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( rechitpully ); - meNpixZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( npix ); - meNxpixZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( nxpix ); - meNypixZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( nypix ); - meChargeZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( charge ); - meResXvsAlphaZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( beta, fabs(rechitresx) ); - meResYvsBetaZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( beta, fabs(rechitresy) ); - mePullXvsAlphaZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( alpha, rechitpullx ); - mePullYvsAlphaZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( alpha, rechitpully ); - mePullXvsBetaZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( beta, rechitpullx ); - mePullYvsBetaZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( beta, rechitpully ); - mePullXvsPhiZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( phi, rechitpullx ); - mePullYvsPhiZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( phi, rechitpully ); - mePullXvsEtaZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( eta, rechitpullx ); - mePullYvsEtaZpPanel1DiskPlaq[disk-1][plaq-1]->Fill( eta, rechitpully ); - - } - else if ( panel==2 ) - { - mePosxZpPanel2->Fill( rechitx ); - mePosyZpPanel2->Fill( rechity ); - meErrxZpPanel2->Fill( rechiterrx ); - meErryZpPanel2->Fill( rechiterry ); - meResxZpPanel2->Fill( rechitresx ); - meResyZpPanel2->Fill( rechitresy ); - mePullxZpPanel2->Fill( rechitpullx ); - mePullyZpPanel2->Fill( rechitpully ); - meNpixZpPanel2->Fill( npix ); - meNxpixZpPanel2->Fill( nxpix ); - meNypixZpPanel2->Fill( nypix ); - meChargeZpPanel2->Fill( charge ); - meResXvsAlphaZpPanel2->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaZpPanel2->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaZpPanel2->Fill( beta, fabs(rechitresx) ); - meResYvsBetaZpPanel2->Fill( beta, fabs(rechitresy) ); - mePullXvsAlphaZpPanel2->Fill( alpha, rechitpullx ); - mePullYvsAlphaZpPanel2->Fill( alpha, rechitpully ); - mePullXvsBetaZpPanel2->Fill( beta, rechitpullx ); - mePullYvsBetaZpPanel2->Fill( beta, rechitpully ); - mePullXvsPhiZpPanel2->Fill( phi, rechitpullx ); - mePullYvsPhiZpPanel2->Fill( phi, rechitpully ); - mePullXvsEtaZpPanel2->Fill( eta, rechitpullx ); - mePullYvsEtaZpPanel2->Fill( eta, rechitpully ); - - meWPullXvsAlphaZpPanel2->Fill( alpha, fabs(rechitpullx) ); - meWPullYvsAlphaZpPanel2->Fill( alpha, fabs(rechitpully) ); - meWPullXvsBetaZpPanel2->Fill( beta, fabs(rechitpullx) ); - meWPullYvsBetaZpPanel2->Fill( beta, fabs(rechitpully) ); - - mePosxZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechitx ); - mePosyZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechity ); - meErrxZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechiterrx ); - meErryZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechiterry ); - meResxZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechitresx ); - meResyZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechitresy ); - mePullxZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechitpullx ); - mePullyZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( rechitpully ); - meNpixZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( npix ); - meNxpixZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( nxpix ); - meNypixZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( nypix ); - meChargeZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( charge ); - meResXvsAlphaZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( alpha, fabs(rechitresx) ); - meResYvsAlphaZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( alpha, fabs(rechitresy) ); - meResXvsBetaZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( beta, fabs(rechitresx) ); - meResYvsBetaZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( beta, fabs(rechitresy) ); - mePullXvsAlphaZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( alpha, rechitpullx ); - mePullYvsAlphaZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( alpha, rechitpully ); - mePullXvsBetaZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( beta, rechitpullx ); - mePullYvsBetaZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( beta, rechitpully ); - mePullXvsPhiZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( phi, rechitpullx ); - mePullYvsPhiZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( phi, rechitpully ); - mePullXvsEtaZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( eta, rechitpullx ); - mePullYvsEtaZpPanel2DiskPlaq[disk-1][plaq-1]->Fill( eta, rechitpully ); - - } - else edm::LogWarning("SiPixelTrackingRecHitsValid") << "..............................................Wrong panel number !"; - } //else if ( side==2 ) - else edm::LogWarning("SiPixelTrackingRecHitsValid") << ".......................................................Wrong side !" ; - - } // else if ( detId.subdetId()==PixelSubdetector::PixelEndcap ) - else edm::LogWarning("SiPixelTrackingRecHitsValid") << "Pixel rechit but we are not in the pixel detector" << (int)detId.subdetId() ; - - if(!debugNtuple_.empty())t_->Fill(); - - } // if ( !matched.empty() ) - //else - //cout << "---------------- RecHit with no associated SimHit !!! -------------------------- " << endl; - - } // matchedhit. - - } // end of loop on hits - - mePixRecHitsPerTrack->Fill( n_hits ); - //cout << "n_hits = " << n_hits << endl; - - } //end of loop on track - - } // tracks > 0. - - } //end of MTCCTrack - + es.get().get(pDD); + const TrackerGeometry* tracker = &(*pDD); + + if (!MTCCtrack_) { + // --------------------------------------- all hits ----------------------------------------------------------- + //--- Fetch Pixel RecHits + edm::Handle recHitColl; + e.getByToken(siPixelRecHitCollectionToken_, recHitColl); + + //cout <<" ----- Found " + // << const_cast(recHitColl.product())->size() + // << " Pixel RecHits" << std::endl; + + //-----Iterate over detunits + for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++) { + DetId detId = ((*it)->geographicalId()); + + unsigned int subid = detId.subdetId(); + if (!((subid == 1) || (subid == 2))) + continue; // end subid if + + SiPixelRecHitCollection::const_iterator match = recHitColl->find(detId); + if (match == recHitColl->end()) + continue; + + SiPixelRecHitCollection::DetSet pixelrechitRange = *match; + SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorBegin = pixelrechitRange.begin(); + SiPixelRecHitCollection::DetSet::const_iterator pixelrechitRangeIteratorEnd = pixelrechitRange.end(); + SiPixelRecHitCollection::DetSet::const_iterator pixeliter = pixelrechitRangeIteratorBegin; + std::vector matched; + + //----Loop over rechits for this detId + for (; pixeliter != pixelrechitRangeIteratorEnd; ++pixeliter) { + LocalPoint lp = pixeliter->localPosition(); + float rechitx = lp.x(); + float rechity = lp.y(); + + detId = (*it)->geographicalId(); + subdetId = (int)detId.subdetId(); + if ((int)detId.subdetId() == (int)PixelSubdetector::PixelBarrel) { + mePosxBarrel_all_hits->Fill(rechitx); + mePosyBarrel_all_hits->Fill(rechity); + } else if ((int)detId.subdetId() == (int)PixelSubdetector::PixelEndcap) { + side = tTopo->pxfSide(detId); + disk = tTopo->pxfDisk(detId); + blade = tTopo->pxfBlade(detId); + panel = tTopo->pxfPanel(detId); + plaq = tTopo->pxfModule(detId); // also known as plaquette + + if (side == 1) { + if (panel == 1) { + mePosxZmPanel1_all_hits->Fill(rechitx); + mePosyZmPanel1_all_hits->Fill(rechity); + } else if (panel == 2) { + mePosxZmPanel2_all_hits->Fill(rechitx); + mePosyZmPanel2_all_hits->Fill(rechity); + } else + edm::LogWarning("SiPixelTrackingRecHitsValid") + << "..............................................Wrong panel number !"; + } // if ( side==1 ) + else if (side == 2) { + if (panel == 1) { + mePosxZpPanel1_all_hits->Fill(rechitx); + mePosyZpPanel1_all_hits->Fill(rechity); + } else if (panel == 2) { + mePosxZpPanel2_all_hits->Fill(rechitx); + mePosyZpPanel2_all_hits->Fill(rechity); + } else + edm::LogWarning("SiPixelTrackingRecHitsValid") + << "..............................................Wrong panel number !"; + } //else if ( side==2 ) + else + edm::LogWarning("SiPixelTrackingRecHitsValid") + << ".......................................................Wrong side !"; + + } // else if ( detId.subdetId()==PixelSubdetector::PixelEndcap ) + else + edm::LogWarning("SiPixelTrackingRecHitsValid") + << "Pixel rechit collection but we are not in the pixel detector" << (int)detId.subdetId(); + } + } + // ------------------------------------------------ all hits --------------------------------------------------------------- + + // Get tracks + edm::Handle trackCollection; + e.getByToken(recoTrackCollectionToken_, trackCollection); + const reco::TrackCollection* tracks = trackCollection.product(); + reco::TrackCollection::const_iterator tciter; + + int n_tracks = (int)tracks->size(); // number of tracks in this event + meTracksPerEvent->Fill(n_tracks); + + if (!tracks->empty()) { + // Loop on tracks + for (tciter = tracks->begin(); tciter != tracks->end(); tciter++) { + phi = tciter->momentum().phi() / math_pi * 180.0; + eta = tciter->momentum().eta(); + + int n_hits = 0; + // First loop on hits: find matched hits + for (trackingRecHit_iterator it = tciter->recHitsBegin(); it != tciter->recHitsEnd(); it++) { + const TrackingRecHit& thit = **it; + // Is it a matched hit? + const SiPixelRecHit* matchedhit = dynamic_cast(&thit); + + if (matchedhit) { + ++n_hits; + + layer = -9999; + ladder = -9999; + mod = -9999; + side = -9999; + disk = -9999; + blade = -9999; + panel = -9999; + plaq = -9999; + + rechitx = -9999.9; + rechity = -9999.9; + rechitz = -9999.9; + rechiterrx = -9999.9; + rechiterry = -9999.9; + rechitresx = -9999.9; + rechitresy = -9999.9; + rechitpullx = -9999.9; + rechitpully = -9999.9; + + npix = -9999; + nxpix = -9999; + nypix = -9999; + charge = -9999.9; + + alpha = -9999.9; + beta = -9999.9; + + half = -9999; + flipped = -9999; + + nsimhit = -9999; + + simhitx = -9999.9; + simhity = -9999.9; + + position = (*it)->localPosition(); + error = (*it)->localPositionError(); + + rechitx = position.x(); + rechity = position.y(); + rechitz = position.z(); + rechiterrx = sqrt(error.xx()); + rechiterry = sqrt(error.yy()); + + npix = (*matchedhit).cluster()->size(); + nxpix = (*matchedhit).cluster()->sizeX(); + nypix = (*matchedhit).cluster()->sizeY(); + charge = (*matchedhit).cluster()->charge(); + + //Association of the rechit to the simhit + matched.clear(); + matched = associate.associateHit(*matchedhit); + + nsimhit = (int)matched.size(); + + if (!matched.empty()) { + mindist = 999999.9; + float distx, disty, dist; + bool found_hit_from_generated_particle = false; + + int n_assoc_muon = 0; + + std::vector::const_iterator closestit = matched.begin(); + for (std::vector::const_iterator m = matched.begin(); m < matched.end(); m++) { + if (checkType_) { + int pid = (*m).particleType(); + if (abs(pid) != genType_) + continue; + } + + float simhitx = 0.5 * ((*m).entryPoint().x() + (*m).exitPoint().x()); + float simhity = 0.5 * ((*m).entryPoint().y() + (*m).exitPoint().y()); + + distx = fabs(rechitx - simhitx); + disty = fabs(rechity - simhity); + dist = sqrt(distx * distx + disty * disty); + + if (dist < mindist) { + n_assoc_muon++; + + mindist = dist; + closestit = m; + found_hit_from_generated_particle = true; + } + } // for (std::vector::const_iterator m=matched.begin(); m 1) { + edm::LogWarning("SiPixelTrackingRecHitsValid") + << " ----- This is not good: n_assoc_muon = " << n_assoc_muon; + edm::LogWarning("SiPixelTrackingRecHitsValid") << "evt = " << evt; + } + + pidhit = (*closestit).particleType(); + + simhitx = 0.5 * ((*closestit).entryPoint().x() + (*closestit).exitPoint().x()); + simhity = 0.5 * ((*closestit).entryPoint().y() + (*closestit).exitPoint().y()); + + rechitresx = rechitx - simhitx; + rechitresy = rechity - simhity; + rechitpullx = (rechitx - simhitx) / sqrt(error.xx()); + rechitpully = (rechity - simhity) / sqrt(error.yy()); + + float simhitpx = (*closestit).momentumAtEntry().x(); + float simhitpy = (*closestit).momentumAtEntry().y(); + float simhitpz = (*closestit).momentumAtEntry().z(); + + //beta = atan2(simhitpz, simhitpy) * radtodeg; + //alpha = atan2(simhitpz, simhitpx) * radtodeg; + + beta = fabs(atan2(simhitpz, simhitpy)) * radtodeg; + alpha = fabs(atan2(simhitpz, simhitpx)) * radtodeg; + + detId = (*it)->geographicalId(); + + subdetId = (int)detId.subdetId(); + + if ((int)detId.subdetId() == (int)PixelSubdetector::PixelBarrel) { + mePosxBarrel->Fill(rechitx); + mePosyBarrel->Fill(rechity); + meErrxBarrel->Fill(rechiterrx); + meErryBarrel->Fill(rechiterry); + meResxBarrel->Fill(rechitresx); + meResyBarrel->Fill(rechitresy); + mePullxBarrel->Fill(rechitpullx); + mePullyBarrel->Fill(rechitpully); + meNpixBarrel->Fill(npix); + meNxpixBarrel->Fill(nxpix); + meNypixBarrel->Fill(nypix); + meChargeBarrel->Fill(charge); + meResXvsAlphaBarrel->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaBarrel->Fill(alpha, fabs(rechitresy)); + meResXvsBetaBarrel->Fill(beta, fabs(rechitresx)); + meResYvsBetaBarrel->Fill(beta, fabs(rechitresy)); + mePullXvsAlphaBarrel->Fill(alpha, rechitpullx); + mePullYvsAlphaBarrel->Fill(alpha, rechitpully); + mePullXvsBetaBarrel->Fill(beta, rechitpullx); + mePullYvsBetaBarrel->Fill(beta, rechitpully); + mePullXvsPhiBarrel->Fill(phi, rechitpullx); + mePullYvsPhiBarrel->Fill(phi, rechitpully); + mePullXvsEtaBarrel->Fill(eta, rechitpullx); + mePullYvsEtaBarrel->Fill(eta, rechitpully); + + const PixelGeomDetUnit* theGeomDet = dynamic_cast(tracker->idToDet(detId)); + //const PixelTopology * topol = (&(theGeomDet->specificTopology())); + + int tmp_nrows = theGeomDet->specificTopology().nrows(); + + if (tmp_nrows == 80) { + mePosxBarrelHalfModule->Fill(rechitx); + mePosyBarrelHalfModule->Fill(rechity); + half = 1; + } else if (tmp_nrows == 160) { + mePosxBarrelFullModule->Fill(rechitx); + mePosyBarrelFullModule->Fill(rechity); + half = 0; + } else + edm::LogWarning("SiPixelTrackingRecHitsValid") + << "-------------------------------------------------- Wrong module size !!!"; + + float tmp1 = theGeomDet->surface().toGlobal(Local3DPoint(0., 0., 0.)).perp(); + float tmp2 = theGeomDet->surface().toGlobal(Local3DPoint(0., 0., 1.)).perp(); + + if (tmp2 < tmp1) { // flipped + mePosxBarrelFlippedLadders->Fill(rechitx); + mePosyBarrelFlippedLadders->Fill(rechity); + flipped = 1; + + meResXvsAlphaBarrelFlippedLadders->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaBarrelFlippedLadders->Fill(alpha, fabs(rechitresy)); + meResXvsBetaBarrelFlippedLadders->Fill(beta, fabs(rechitresx)); + meResYvsBetaBarrelFlippedLadders->Fill(beta, fabs(rechitresy)); + mePullXvsAlphaBarrelFlippedLadders->Fill(alpha, rechitpullx); + mePullYvsAlphaBarrelFlippedLadders->Fill(alpha, rechitpully); + mePullXvsBetaBarrelFlippedLadders->Fill(beta, rechitpullx); + mePullYvsBetaBarrelFlippedLadders->Fill(beta, rechitpully); + mePullXvsPhiBarrelFlippedLadders->Fill(phi, rechitpullx); + mePullYvsPhiBarrelFlippedLadders->Fill(phi, rechitpully); + mePullXvsEtaBarrelFlippedLadders->Fill(eta, rechitpullx); + mePullYvsEtaBarrelFlippedLadders->Fill(eta, rechitpully); + + meWPullXvsAlphaBarrelFlippedLadders->Fill(alpha, fabs(rechitpullx)); + meWPullYvsAlphaBarrelFlippedLadders->Fill(alpha, fabs(rechitpully)); + meWPullXvsBetaBarrelFlippedLadders->Fill(beta, fabs(rechitpullx)); + meWPullYvsBetaBarrelFlippedLadders->Fill(beta, fabs(rechitpully)); + } else { // not flipped + mePosxBarrelNonFlippedLadders->Fill(rechitx); + mePosyBarrelNonFlippedLadders->Fill(rechity); + flipped = 0; + + meResXvsAlphaBarrelNonFlippedLadders->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaBarrelNonFlippedLadders->Fill(alpha, fabs(rechitresy)); + meResXvsBetaBarrelNonFlippedLadders->Fill(beta, fabs(rechitresx)); + meResYvsBetaBarrelNonFlippedLadders->Fill(beta, fabs(rechitresy)); + mePullXvsAlphaBarrelNonFlippedLadders->Fill(alpha, rechitpullx); + mePullYvsAlphaBarrelNonFlippedLadders->Fill(alpha, rechitpully); + mePullXvsBetaBarrelNonFlippedLadders->Fill(beta, rechitpullx); + mePullYvsBetaBarrelNonFlippedLadders->Fill(beta, rechitpully); + mePullXvsPhiBarrelNonFlippedLadders->Fill(phi, rechitpullx); + mePullYvsPhiBarrelNonFlippedLadders->Fill(phi, rechitpully); + mePullXvsEtaBarrelNonFlippedLadders->Fill(eta, rechitpullx); + mePullYvsEtaBarrelNonFlippedLadders->Fill(eta, rechitpully); + + meWPullXvsAlphaBarrelNonFlippedLadders->Fill(alpha, fabs(rechitpullx)); + meWPullYvsAlphaBarrelNonFlippedLadders->Fill(alpha, fabs(rechitpully)); + meWPullXvsBetaBarrelNonFlippedLadders->Fill(beta, fabs(rechitpullx)); + meWPullYvsBetaBarrelNonFlippedLadders->Fill(beta, fabs(rechitpully)); + } + + layer = tTopo->pxbLayer(detId); // Layer: 1,2,3. + ladder = tTopo->pxbLadder(detId); // Ladder: 1-20, 32, 44. + mod = tTopo->pxbModule(detId); // Mod: 1-8. + + mePosxBarrelLayerModule[layer - 1][mod - 1]->Fill(rechitx); + mePosyBarrelLayerModule[layer - 1][mod - 1]->Fill(rechity); + meErrxBarrelLayerModule[layer - 1][mod - 1]->Fill(rechiterrx); + meErryBarrelLayerModule[layer - 1][mod - 1]->Fill(rechiterry); + meResxBarrelLayerModule[layer - 1][mod - 1]->Fill(rechitresx); + meResyBarrelLayerModule[layer - 1][mod - 1]->Fill(rechitresy); + mePullxBarrelLayerModule[layer - 1][mod - 1]->Fill(rechitpullx); + mePullyBarrelLayerModule[layer - 1][mod - 1]->Fill(rechitpully); + meNpixBarrelLayerModule[layer - 1][mod - 1]->Fill(npix); + meNxpixBarrelLayerModule[layer - 1][mod - 1]->Fill(nxpix); + meNypixBarrelLayerModule[layer - 1][mod - 1]->Fill(nypix); + meChargeBarrelLayerModule[layer - 1][mod - 1]->Fill(charge); + meResXvsAlphaBarrelLayerModule[layer - 1][mod - 1]->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaBarrelLayerModule[layer - 1][mod - 1]->Fill(alpha, fabs(rechitresy)); + meResXvsBetaBarrelLayerModule[layer - 1][mod - 1]->Fill(beta, fabs(rechitresx)); + meResYvsBetaBarrelLayerModule[layer - 1][mod - 1]->Fill(beta, fabs(rechitresy)); + mePullXvsAlphaBarrelLayerModule[layer - 1][mod - 1]->Fill(alpha, rechitpullx); + mePullYvsAlphaBarrelLayerModule[layer - 1][mod - 1]->Fill(alpha, rechitpully); + mePullXvsBetaBarrelLayerModule[layer - 1][mod - 1]->Fill(beta, rechitpullx); + mePullYvsBetaBarrelLayerModule[layer - 1][mod - 1]->Fill(beta, rechitpully); + mePullXvsPhiBarrelLayerModule[layer - 1][mod - 1]->Fill(phi, rechitpullx); + mePullYvsPhiBarrelLayerModule[layer - 1][mod - 1]->Fill(phi, rechitpully); + mePullXvsEtaBarrelLayerModule[layer - 1][mod - 1]->Fill(eta, rechitpullx); + mePullYvsEtaBarrelLayerModule[layer - 1][mod - 1]->Fill(eta, rechitpully); + + meResxBarrelLayer[layer - 1]->Fill(rechitresx); + meResyBarrelLayer[layer - 1]->Fill(rechitresy); + mePullxBarrelLayer[layer - 1]->Fill(rechitpullx); + mePullyBarrelLayer[layer - 1]->Fill(rechitpully); + + if (tmp2 < tmp1) { // flipped + meResXvsAlphaBarrelFlippedLaddersLayer[layer - 1]->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaBarrelFlippedLaddersLayer[layer - 1]->Fill(alpha, fabs(rechitresy)); + meResXvsBetaBarrelFlippedLaddersLayer[layer - 1]->Fill(beta, fabs(rechitresx)); + meResYvsBetaBarrelFlippedLaddersLayer[layer - 1]->Fill(beta, fabs(rechitresy)); + } else { // not flipped + meResXvsAlphaBarrelNonFlippedLaddersLayer[layer - 1]->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaBarrelNonFlippedLaddersLayer[layer - 1]->Fill(alpha, fabs(rechitresy)); + meResXvsBetaBarrelNonFlippedLaddersLayer[layer - 1]->Fill(beta, fabs(rechitresx)); + meResYvsBetaBarrelNonFlippedLaddersLayer[layer - 1]->Fill(beta, fabs(rechitresy)); + } + + } else if ((int)detId.subdetId() == (int)PixelSubdetector::PixelEndcap) { + side = tTopo->pxfSide(detId); + disk = tTopo->pxfDisk(detId); + blade = tTopo->pxfBlade(detId); + panel = tTopo->pxfPanel(detId); + plaq = tTopo->pxfModule(detId); // also known as plaquette + + if (side == 1) { + if (panel == 1) { + mePosxZmPanel1->Fill(rechitx); + mePosyZmPanel1->Fill(rechity); + meErrxZmPanel1->Fill(rechiterrx); + meErryZmPanel1->Fill(rechiterry); + meResxZmPanel1->Fill(rechitresx); + meResyZmPanel1->Fill(rechitresy); + mePullxZmPanel1->Fill(rechitpullx); + mePullyZmPanel1->Fill(rechitpully); + meNpixZmPanel1->Fill(npix); + meNxpixZmPanel1->Fill(nxpix); + meNypixZmPanel1->Fill(nypix); + meChargeZmPanel1->Fill(charge); + meResXvsAlphaZmPanel1->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaZmPanel1->Fill(alpha, fabs(rechitresy)); + meResXvsBetaZmPanel1->Fill(beta, fabs(rechitresx)); + meResYvsBetaZmPanel1->Fill(beta, fabs(rechitresy)); + mePullXvsAlphaZmPanel1->Fill(alpha, rechitpullx); + mePullYvsAlphaZmPanel1->Fill(alpha, rechitpully); + mePullXvsBetaZmPanel1->Fill(beta, rechitpullx); + mePullYvsBetaZmPanel1->Fill(beta, rechitpully); + mePullXvsPhiZmPanel1->Fill(phi, rechitpullx); + mePullYvsPhiZmPanel1->Fill(phi, rechitpully); + mePullXvsEtaZmPanel1->Fill(eta, rechitpullx); + mePullYvsEtaZmPanel1->Fill(eta, rechitpully); + + meWPullXvsAlphaZmPanel1->Fill(alpha, fabs(rechitpullx)); + meWPullYvsAlphaZmPanel1->Fill(alpha, fabs(rechitpully)); + meWPullXvsBetaZmPanel1->Fill(beta, fabs(rechitpullx)); + meWPullYvsBetaZmPanel1->Fill(beta, fabs(rechitpully)); + + mePosxZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechitx); + mePosyZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechity); + meErrxZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechiterrx); + meErryZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechiterry); + meResxZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechitresx); + meResyZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechitresy); + mePullxZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechitpullx); + mePullyZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechitpully); + meNpixZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(npix); + meNxpixZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(nxpix); + meNypixZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(nypix); + meChargeZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(charge); + meResXvsAlphaZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, fabs(rechitresy)); + meResXvsBetaZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(beta, fabs(rechitresx)); + meResYvsBetaZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(beta, fabs(rechitresy)); + mePullXvsAlphaZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, rechitpullx); + mePullYvsAlphaZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, rechitpully); + mePullXvsBetaZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(beta, rechitpullx); + mePullYvsBetaZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(beta, rechitpully); + mePullXvsPhiZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(phi, rechitpullx); + mePullYvsPhiZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(phi, rechitpully); + mePullXvsEtaZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(eta, rechitpullx); + mePullYvsEtaZmPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(eta, rechitpully); + + } else if (panel == 2) { + mePosxZmPanel2->Fill(rechitx); + mePosyZmPanel2->Fill(rechity); + meErrxZmPanel2->Fill(rechiterrx); + meErryZmPanel2->Fill(rechiterry); + meResxZmPanel2->Fill(rechitresx); + meResyZmPanel2->Fill(rechitresy); + mePullxZmPanel2->Fill(rechitpullx); + mePullyZmPanel2->Fill(rechitpully); + meNpixZmPanel2->Fill(npix); + meNxpixZmPanel2->Fill(nxpix); + meNypixZmPanel2->Fill(nypix); + meChargeZmPanel2->Fill(charge); + meResXvsAlphaZmPanel2->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaZmPanel2->Fill(alpha, fabs(rechitresy)); + meResXvsBetaZmPanel2->Fill(beta, fabs(rechitresx)); + meResYvsBetaZmPanel2->Fill(beta, fabs(rechitresy)); + mePullXvsAlphaZmPanel2->Fill(alpha, rechitpullx); + mePullYvsAlphaZmPanel2->Fill(alpha, rechitpully); + mePullXvsBetaZmPanel2->Fill(beta, rechitpullx); + mePullYvsBetaZmPanel2->Fill(beta, rechitpully); + mePullXvsPhiZmPanel2->Fill(phi, rechitpullx); + mePullYvsPhiZmPanel2->Fill(phi, rechitpully); + mePullXvsEtaZmPanel2->Fill(eta, rechitpullx); + mePullYvsEtaZmPanel2->Fill(eta, rechitpully); + + meWPullXvsAlphaZmPanel2->Fill(alpha, fabs(rechitpullx)); + meWPullYvsAlphaZmPanel2->Fill(alpha, fabs(rechitpully)); + meWPullXvsBetaZmPanel2->Fill(beta, fabs(rechitpullx)); + meWPullYvsBetaZmPanel2->Fill(beta, fabs(rechitpully)); + + mePosxZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechitx); + mePosyZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechity); + meErrxZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechiterrx); + meErryZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechiterry); + meResxZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechitresx); + meResyZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechitresy); + mePullxZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechitpullx); + mePullyZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechitpully); + meNpixZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(npix); + meNxpixZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(nxpix); + meNypixZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(nypix); + meChargeZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(charge); + meResXvsAlphaZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, fabs(rechitresy)); + meResXvsBetaZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(beta, fabs(rechitresx)); + meResYvsBetaZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(beta, fabs(rechitresy)); + mePullXvsAlphaZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, rechitpullx); + mePullYvsAlphaZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, rechitpully); + mePullXvsBetaZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(beta, rechitpullx); + mePullYvsBetaZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(beta, rechitpully); + mePullXvsPhiZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(phi, rechitpullx); + mePullYvsPhiZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(phi, rechitpully); + mePullXvsEtaZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(eta, rechitpullx); + mePullYvsEtaZmPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(eta, rechitpully); + + } else + edm::LogWarning("SiPixelTrackingRecHitsValid") + << "..............................................Wrong panel number !"; + } // if ( side==1 ) + else if (side == 2) { + if (panel == 1) { + mePosxZpPanel1->Fill(rechitx); + mePosyZpPanel1->Fill(rechity); + meErrxZpPanel1->Fill(rechiterrx); + meErryZpPanel1->Fill(rechiterry); + meResxZpPanel1->Fill(rechitresx); + meResyZpPanel1->Fill(rechitresy); + mePullxZpPanel1->Fill(rechitpullx); + mePullyZpPanel1->Fill(rechitpully); + meNpixZpPanel1->Fill(npix); + meNxpixZpPanel1->Fill(nxpix); + meNypixZpPanel1->Fill(nypix); + meChargeZpPanel1->Fill(charge); + meResXvsAlphaZpPanel1->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaZpPanel1->Fill(alpha, fabs(rechitresy)); + meResXvsBetaZpPanel1->Fill(beta, fabs(rechitresx)); + meResYvsBetaZpPanel1->Fill(beta, fabs(rechitresy)); + mePullXvsAlphaZpPanel1->Fill(alpha, rechitpullx); + mePullYvsAlphaZpPanel1->Fill(alpha, rechitpully); + mePullXvsBetaZpPanel1->Fill(beta, rechitpullx); + mePullYvsBetaZpPanel1->Fill(beta, rechitpully); + mePullXvsPhiZpPanel1->Fill(phi, rechitpullx); + mePullYvsPhiZpPanel1->Fill(phi, rechitpully); + mePullXvsEtaZpPanel1->Fill(eta, rechitpullx); + mePullYvsEtaZpPanel1->Fill(eta, rechitpully); + + meWPullXvsAlphaZpPanel1->Fill(alpha, fabs(rechitpullx)); + meWPullYvsAlphaZpPanel1->Fill(alpha, fabs(rechitpully)); + meWPullXvsBetaZpPanel1->Fill(beta, fabs(rechitpullx)); + meWPullYvsBetaZpPanel1->Fill(beta, fabs(rechitpully)); + + mePosxZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechitx); + mePosyZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechity); + meErrxZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechiterrx); + meErryZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechiterry); + meResxZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechitresx); + meResyZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechitresy); + mePullxZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechitpullx); + mePullyZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(rechitpully); + meNpixZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(npix); + meNxpixZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(nxpix); + meNypixZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(nypix); + meChargeZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(charge); + meResXvsAlphaZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, fabs(rechitresy)); + meResXvsBetaZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(beta, fabs(rechitresx)); + meResYvsBetaZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(beta, fabs(rechitresy)); + mePullXvsAlphaZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, rechitpullx); + mePullYvsAlphaZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, rechitpully); + mePullXvsBetaZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(beta, rechitpullx); + mePullYvsBetaZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(beta, rechitpully); + mePullXvsPhiZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(phi, rechitpullx); + mePullYvsPhiZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(phi, rechitpully); + mePullXvsEtaZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(eta, rechitpullx); + mePullYvsEtaZpPanel1DiskPlaq[disk - 1][plaq - 1]->Fill(eta, rechitpully); + + } else if (panel == 2) { + mePosxZpPanel2->Fill(rechitx); + mePosyZpPanel2->Fill(rechity); + meErrxZpPanel2->Fill(rechiterrx); + meErryZpPanel2->Fill(rechiterry); + meResxZpPanel2->Fill(rechitresx); + meResyZpPanel2->Fill(rechitresy); + mePullxZpPanel2->Fill(rechitpullx); + mePullyZpPanel2->Fill(rechitpully); + meNpixZpPanel2->Fill(npix); + meNxpixZpPanel2->Fill(nxpix); + meNypixZpPanel2->Fill(nypix); + meChargeZpPanel2->Fill(charge); + meResXvsAlphaZpPanel2->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaZpPanel2->Fill(alpha, fabs(rechitresy)); + meResXvsBetaZpPanel2->Fill(beta, fabs(rechitresx)); + meResYvsBetaZpPanel2->Fill(beta, fabs(rechitresy)); + mePullXvsAlphaZpPanel2->Fill(alpha, rechitpullx); + mePullYvsAlphaZpPanel2->Fill(alpha, rechitpully); + mePullXvsBetaZpPanel2->Fill(beta, rechitpullx); + mePullYvsBetaZpPanel2->Fill(beta, rechitpully); + mePullXvsPhiZpPanel2->Fill(phi, rechitpullx); + mePullYvsPhiZpPanel2->Fill(phi, rechitpully); + mePullXvsEtaZpPanel2->Fill(eta, rechitpullx); + mePullYvsEtaZpPanel2->Fill(eta, rechitpully); + + meWPullXvsAlphaZpPanel2->Fill(alpha, fabs(rechitpullx)); + meWPullYvsAlphaZpPanel2->Fill(alpha, fabs(rechitpully)); + meWPullXvsBetaZpPanel2->Fill(beta, fabs(rechitpullx)); + meWPullYvsBetaZpPanel2->Fill(beta, fabs(rechitpully)); + + mePosxZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechitx); + mePosyZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechity); + meErrxZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechiterrx); + meErryZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechiterry); + meResxZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechitresx); + meResyZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechitresy); + mePullxZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechitpullx); + mePullyZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(rechitpully); + meNpixZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(npix); + meNxpixZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(nxpix); + meNypixZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(nypix); + meChargeZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(charge); + meResXvsAlphaZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, fabs(rechitresx)); + meResYvsAlphaZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, fabs(rechitresy)); + meResXvsBetaZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(beta, fabs(rechitresx)); + meResYvsBetaZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(beta, fabs(rechitresy)); + mePullXvsAlphaZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, rechitpullx); + mePullYvsAlphaZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(alpha, rechitpully); + mePullXvsBetaZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(beta, rechitpullx); + mePullYvsBetaZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(beta, rechitpully); + mePullXvsPhiZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(phi, rechitpullx); + mePullYvsPhiZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(phi, rechitpully); + mePullXvsEtaZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(eta, rechitpullx); + mePullYvsEtaZpPanel2DiskPlaq[disk - 1][plaq - 1]->Fill(eta, rechitpully); + + } else + edm::LogWarning("SiPixelTrackingRecHitsValid") + << "..............................................Wrong panel number !"; + } //else if ( side==2 ) + else + edm::LogWarning("SiPixelTrackingRecHitsValid") + << ".......................................................Wrong side !"; + + } // else if ( detId.subdetId()==PixelSubdetector::PixelEndcap ) + else + edm::LogWarning("SiPixelTrackingRecHitsValid") + << "Pixel rechit but we are not in the pixel detector" << (int)detId.subdetId(); + + if (!debugNtuple_.empty()) + t_->Fill(); + + } // if ( !matched.empty() ) + //else + //cout << "---------------- RecHit with no associated SimHit !!! -------------------------- " << endl; + + } // matchedhit. + + } // end of loop on hits + + mePixRecHitsPerTrack->Fill(n_hits); + //cout << "n_hits = " << n_hits << endl; + + } //end of loop on track + + } // tracks > 0. + + } //end of MTCCTrack } diff --git a/Validation/RecoTrack/plugins/TrackFromSeedProducer.cc b/Validation/RecoTrack/plugins/TrackFromSeedProducer.cc index 426744bdb07e0..509f67c6fe603 100644 --- a/Validation/RecoTrack/plugins/TrackFromSeedProducer.cc +++ b/Validation/RecoTrack/plugins/TrackFromSeedProducer.cc @@ -2,7 +2,7 @@ // // Package: FastSimulation/TrackFromSeedProducer // Class: TrackFromSeedProducer -// +// /**\class TrackFromSeedProducer TrackFromSeedProducer.cc FastSimulation/TrackFromSeedProducer/plugins/TrackFromSeedProducer.cc Description: [one line class summary] @@ -16,7 +16,6 @@ // // - // system include files #include @@ -38,7 +37,7 @@ #include "TrackingTools/TrajectoryState/interface/PerigeeConversions.h" #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h" #include "TrackingTools/Records/interface/TransientRecHitRecord.h" -#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" +#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h" #include "DataFormats/BeamSpot/interface/BeamSpot.h" @@ -50,12 +49,12 @@ class TrackFromSeedProducer : public edm::global::EDProducer<> { public: explicit TrackFromSeedProducer(const edm::ParameterSet&); ~TrackFromSeedProducer() override; - + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - + private: void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; - + // ----------member data --------------------------- edm::EDGetTokenT > seedsToken; edm::EDGetTokenT beamSpotToken; @@ -66,7 +65,6 @@ class TrackFromSeedProducer : public edm::global::EDProducer<> { // constants, enums and typedefs // - // // static data member definitions // @@ -74,8 +72,7 @@ class TrackFromSeedProducer : public edm::global::EDProducer<> { // // constructors and destructor // -TrackFromSeedProducer::TrackFromSeedProducer(const edm::ParameterSet& iConfig) -{ +TrackFromSeedProducer::TrackFromSeedProducer(const edm::ParameterSet& iConfig) { //register your products produces(); produces(); @@ -85,107 +82,107 @@ TrackFromSeedProducer::TrackFromSeedProducer(const edm::ParameterSet& iConfig) edm::InputTag seedsTag(iConfig.getParameter("src")); edm::InputTag beamSpotTag(iConfig.getParameter("beamSpot")); tTRHBuilderName = iConfig.getParameter("TTRHBuilder"); - + //consumes seedsToken = consumes >(seedsTag); beamSpotToken = consumes(beamSpotTag); } - TrackFromSeedProducer::~TrackFromSeedProducer() {} // ------------ method called to produce the data ------------ -void -TrackFromSeedProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const -{ - using namespace edm; - using namespace reco; - using namespace std; - - // output collection - unique_ptr tracks(new TrackCollection); - unique_ptr rechits(new TrackingRecHitCollection); - unique_ptr trackextras(new TrackExtraCollection); - - // product references - TrackExtraRefProd ref_trackextras = iEvent.getRefBeforePut(); - TrackingRecHitRefProd ref_rechits = iEvent.getRefBeforePut(); - - // input collection - Handle > hseeds; - iEvent.getByToken(seedsToken,hseeds); - const auto& seeds = *hseeds; - - // beam spot - edm::Handle beamSpot; - iEvent.getByToken(beamSpotToken,beamSpot); - - // some objects to build to tracks - TSCBLBuilderNoMaterial tscblBuilder; - - edm::ESHandle tTRHBuilder; - iSetup.get().get(tTRHBuilderName,tTRHBuilder); - - edm::ESHandle theMF; - iSetup.get().get(theMF); - - edm::ESHandle httopo; - iSetup.get().get(httopo); - const TrackerTopology& ttopo = *httopo; - - // create tracks from seeds - int nfailed = 0; - for(size_t iSeed=0; iSeed < seeds.size(); ++iSeed) { - auto const& seed = seeds[iSeed]; - // try to create a track - TransientTrackingRecHit::RecHitPointer lastRecHit = tTRHBuilder->build(&*(seed.recHits().second-1)); - TrajectoryStateOnSurface state = trajectoryStateTransform::transientState( seed.startingState(), lastRecHit->surface(), theMF.product()); - TrajectoryStateClosestToBeamLine tsAtClosestApproachSeed = tscblBuilder(*state.freeState(),*beamSpot);//as in TrackProducerAlgorithm - if(tsAtClosestApproachSeed.isValid()) { - const reco::TrackBase::Point vSeed1(tsAtClosestApproachSeed.trackStateAtPCA().position().x(), - tsAtClosestApproachSeed.trackStateAtPCA().position().y(), - tsAtClosestApproachSeed.trackStateAtPCA().position().z()); - const reco::TrackBase::Vector pSeed(tsAtClosestApproachSeed.trackStateAtPCA().momentum().x(), - tsAtClosestApproachSeed.trackStateAtPCA().momentum().y(), - tsAtClosestApproachSeed.trackStateAtPCA().momentum().z()); - //GlobalPoint vSeed(vSeed1.x()-beamSpot->x0(),vSeed1.y()-beamSpot->y0(),vSeed1.z()-beamSpot->z0()); - PerigeeTrajectoryError seedPerigeeErrors = PerigeeConversions::ftsToPerigeeError(tsAtClosestApproachSeed.trackStateAtPCA()); - tracks->emplace_back(0.,0., vSeed1, pSeed, state.charge(), seedPerigeeErrors.covarianceMatrix()); - } - else { - edm::LogVerbatim("SeedValidator")<<"TrajectoryStateClosestToBeamLine not valid"; - // use magic values chi2<0, ndof<0, charge=0 to denote a case where the fit has failed - // If this definition is changed, change also interface/trackFromSeedFitFailed.h - tracks->emplace_back(-1, -1, reco::TrackBase::Point(), reco::TrackBase::Vector(), 0, reco::TrackBase::CovarianceMatrix()); - nfailed++; - } - - tracks->back().appendHits(seed.recHits().first,seed.recHits().second,ttopo); - // store the hits - size_t firsthitindex = rechits->size(); - for(auto hitit = seed.recHits().first;hitit != seed.recHits().second;++hitit){ - rechits->push_back(*hitit); - } - - // create a trackextra, just to store the hit range - trackextras->push_back(TrackExtra()); - trackextras->back().setHits(ref_rechits,firsthitindex,rechits->size() - firsthitindex); - trackextras->back().setSeedRef(edm::RefToBase(hseeds, iSeed)); - // create link between track and trackextra - tracks->back().setExtra( TrackExtraRef( ref_trackextras, trackextras->size() - 1) ); - } - - if (nfailed > 0) { - edm::LogInfo("SeedValidator") << "failed to create tracks from " << nfailed << " out of " << seeds.size() << " seeds "; - } - iEvent.put(std::move(tracks)); - iEvent.put(std::move(rechits)); - iEvent.put(std::move(trackextras)); +void TrackFromSeedProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { + using namespace edm; + using namespace reco; + using namespace std; + + // output collection + unique_ptr tracks(new TrackCollection); + unique_ptr rechits(new TrackingRecHitCollection); + unique_ptr trackextras(new TrackExtraCollection); + + // product references + TrackExtraRefProd ref_trackextras = iEvent.getRefBeforePut(); + TrackingRecHitRefProd ref_rechits = iEvent.getRefBeforePut(); + + // input collection + Handle > hseeds; + iEvent.getByToken(seedsToken, hseeds); + const auto& seeds = *hseeds; + + // beam spot + edm::Handle beamSpot; + iEvent.getByToken(beamSpotToken, beamSpot); + + // some objects to build to tracks + TSCBLBuilderNoMaterial tscblBuilder; + + edm::ESHandle tTRHBuilder; + iSetup.get().get(tTRHBuilderName, tTRHBuilder); + + edm::ESHandle theMF; + iSetup.get().get(theMF); + + edm::ESHandle httopo; + iSetup.get().get(httopo); + const TrackerTopology& ttopo = *httopo; + + // create tracks from seeds + int nfailed = 0; + for (size_t iSeed = 0; iSeed < seeds.size(); ++iSeed) { + auto const& seed = seeds[iSeed]; + // try to create a track + TransientTrackingRecHit::RecHitPointer lastRecHit = tTRHBuilder->build(&*(seed.recHits().second - 1)); + TrajectoryStateOnSurface state = + trajectoryStateTransform::transientState(seed.startingState(), lastRecHit->surface(), theMF.product()); + TrajectoryStateClosestToBeamLine tsAtClosestApproachSeed = + tscblBuilder(*state.freeState(), *beamSpot); //as in TrackProducerAlgorithm + if (tsAtClosestApproachSeed.isValid()) { + const reco::TrackBase::Point vSeed1(tsAtClosestApproachSeed.trackStateAtPCA().position().x(), + tsAtClosestApproachSeed.trackStateAtPCA().position().y(), + tsAtClosestApproachSeed.trackStateAtPCA().position().z()); + const reco::TrackBase::Vector pSeed(tsAtClosestApproachSeed.trackStateAtPCA().momentum().x(), + tsAtClosestApproachSeed.trackStateAtPCA().momentum().y(), + tsAtClosestApproachSeed.trackStateAtPCA().momentum().z()); + //GlobalPoint vSeed(vSeed1.x()-beamSpot->x0(),vSeed1.y()-beamSpot->y0(),vSeed1.z()-beamSpot->z0()); + PerigeeTrajectoryError seedPerigeeErrors = + PerigeeConversions::ftsToPerigeeError(tsAtClosestApproachSeed.trackStateAtPCA()); + tracks->emplace_back(0., 0., vSeed1, pSeed, state.charge(), seedPerigeeErrors.covarianceMatrix()); + } else { + edm::LogVerbatim("SeedValidator") << "TrajectoryStateClosestToBeamLine not valid"; + // use magic values chi2<0, ndof<0, charge=0 to denote a case where the fit has failed + // If this definition is changed, change also interface/trackFromSeedFitFailed.h + tracks->emplace_back( + -1, -1, reco::TrackBase::Point(), reco::TrackBase::Vector(), 0, reco::TrackBase::CovarianceMatrix()); + nfailed++; + } + + tracks->back().appendHits(seed.recHits().first, seed.recHits().second, ttopo); + // store the hits + size_t firsthitindex = rechits->size(); + for (auto hitit = seed.recHits().first; hitit != seed.recHits().second; ++hitit) { + rechits->push_back(*hitit); + } + + // create a trackextra, just to store the hit range + trackextras->push_back(TrackExtra()); + trackextras->back().setHits(ref_rechits, firsthitindex, rechits->size() - firsthitindex); + trackextras->back().setSeedRef(edm::RefToBase(hseeds, iSeed)); + // create link between track and trackextra + tracks->back().setExtra(TrackExtraRef(ref_trackextras, trackextras->size() - 1)); + } + + if (nfailed > 0) { + edm::LogInfo("SeedValidator") << "failed to create tracks from " << nfailed << " out of " << seeds.size() + << " seeds "; + } + iEvent.put(std::move(tracks)); + iEvent.put(std::move(rechits)); + iEvent.put(std::move(trackextras)); } // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ -void -TrackFromSeedProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { +void TrackFromSeedProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { //The following says we do not know what parameters are allowed so do no validation // Please change this to state exactly what you do use, even if it is no parameters edm::ParameterSetDescription desc; diff --git a/Validation/RecoTrack/plugins/TrackingNtuple.cc b/Validation/RecoTrack/plugins/TrackingNtuple.cc index 92bbbc95d4290..891d08a051d72 100644 --- a/Validation/RecoTrack/plugins/TrackingNtuple.cc +++ b/Validation/RecoTrack/plugins/TrackingNtuple.cc @@ -16,7 +16,6 @@ // // - // system include files #include @@ -115,24 +114,30 @@ namespace { using SimHitRefKeyToIndex = std::map; using TrackingParticleRefKeyToCount = TrackingParticleRefKeyToIndex; - std::string subdetstring(int subdet) { - switch(subdet) { - case StripSubdetector::TIB: return "- TIB"; - case StripSubdetector::TOB: return "- TOB"; - case StripSubdetector::TEC: return "- TEC"; - case StripSubdetector::TID: return "- TID"; - case PixelSubdetector::PixelBarrel: return "- PixBar"; - case PixelSubdetector::PixelEndcap: return "- PixFwd"; - default: return "UNKNOWN TRACKER HIT TYPE"; + switch (subdet) { + case StripSubdetector::TIB: + return "- TIB"; + case StripSubdetector::TOB: + return "- TOB"; + case StripSubdetector::TEC: + return "- TEC"; + case StripSubdetector::TID: + return "- TID"; + case PixelSubdetector::PixelBarrel: + return "- PixBar"; + case PixelSubdetector::PixelEndcap: + return "- PixFwd"; + default: + return "UNKNOWN TRACKER HIT TYPE"; } } struct ProductIDSetPrinter { - ProductIDSetPrinter(const std::set& set): set_(set) {} + ProductIDSetPrinter(const std::set& set) : set_(set) {} void print(std::ostream& os) const { - for(const auto& item: set_) { + for (const auto& item : set_) { os << item << " "; } } @@ -145,10 +150,10 @@ namespace { } template struct ProductIDMapPrinter { - ProductIDMapPrinter(const std::map& map): map_(map) {} + ProductIDMapPrinter(const std::map& map) : map_(map) {} void print(std::ostream& os) const { - for(const auto& item: map_) { + for (const auto& item : map_) { os << item.first << " "; } } @@ -167,10 +172,10 @@ namespace { template struct VectorPrinter { - VectorPrinter(const std::vector& vec): vec_(vec) {} + VectorPrinter(const std::vector& vec) : vec_(vec) {} void print(std::ostream& os) const { - for(const auto& item: vec_) { + for (const auto& item : vec_) { os << item << " "; } } @@ -187,54 +192,52 @@ namespace { return os; } - void checkProductID(const std::set& set, const edm::ProductID& id, const char *name) { - if(set.find(id) == set.end()) - throw cms::Exception("Configuration") << "Got " << name << " with a hit with ProductID " << id - << " which does not match to the set of ProductID's for the hits: " - << ProductIDSetPrinter(set) - << ". Usually this is caused by a wrong hit collection in the configuration."; + void checkProductID(const std::set& set, const edm::ProductID& id, const char* name) { + if (set.find(id) == set.end()) + throw cms::Exception("Configuration") + << "Got " << name << " with a hit with ProductID " << id + << " which does not match to the set of ProductID's for the hits: " << ProductIDSetPrinter(set) + << ". Usually this is caused by a wrong hit collection in the configuration."; } template void forEachMatchedSimLink(const edm::DetSet& digiSimLinks, uint32_t channel, Func func) { - for(const auto& link: digiSimLinks) { - if(link.channel() == channel) { + for (const auto& link : digiSimLinks) { + if (link.channel() == channel) { func(link); } } } - /// No-op function used in the trick of CombineDetId::impl2() - template void call_nop(Args&&... args) {} + template + void call_nop(Args&&... args) {} - template + template class CombineDetId { public: CombineDetId() {} /// Return the raw DetId, assumes that the first type is /// DetIdCommon that has operator[]() - unsigned int operator[](size_t i) const { - return std::get<0>(content_)[i]; - } + unsigned int operator[](size_t i) const { return std::get<0>(content_)[i]; } - template + template void book(Args&&... args) { impl([&](auto& vec) { vec.book(std::forward(args)...); }); } - template + template void push_back(Args&&... args) { impl([&](auto& vec) { vec.push_back(std::forward(args)...); }); } - template + template void resize(Args&&... args) { impl([&](auto& vec) { vec.resize(std::forward(args)...); }); } - template + template void set(Args&&... args) { impl([&](auto& vec) { vec.set(std::forward(args)...); }); } @@ -255,37 +258,37 @@ namespace { // (with the same signature). The comma operator is needed to // return a value from the expression as an argument for the // call_nop. - template + template void impl2(std::index_sequence, F&& func) { - call_nop( (func(std::get(content_)) , 0)...); + call_nop((func(std::get(content_)), 0)...); } std::tuple content_; }; - - std::map chargeFraction(const SiPixelCluster& cluster, const DetId& detId, - const edm::DetSetVector& digiSimLink) { + std::map chargeFraction(const SiPixelCluster& cluster, + const DetId& detId, + const edm::DetSetVector& digiSimLink) { std::map simTrackIdToAdc; auto idetset = digiSimLink.find(detId); - if(idetset == digiSimLink.end()) + if (idetset == digiSimLink.end()) return simTrackIdToAdc; double adcSum = 0; PixelDigiSimLink found; - for(int iPix=0; iPix != cluster.size(); ++iPix) { + for (int iPix = 0; iPix != cluster.size(); ++iPix) { const SiPixelCluster::Pixel& pixel = cluster.pixel(iPix); adcSum += pixel.adc; uint32_t channel = PixelChannelIdentifier::pixelToChannel(pixel.x, pixel.y); - forEachMatchedSimLink(*idetset, channel, [&](const PixelDigiSimLink& simLink){ - double& adc = simTrackIdToAdc[simLink.SimTrackId()]; - adc += pixel.adc*simLink.fraction(); - }); + forEachMatchedSimLink(*idetset, channel, [&](const PixelDigiSimLink& simLink) { + double& adc = simTrackIdToAdc[simLink.SimTrackId()]; + adc += pixel.adc * simLink.fraction(); + }); } - for(auto& pair: simTrackIdToAdc) { - if(adcSum == 0.) + for (auto& pair : simTrackIdToAdc) { + if (adcSum == 0.) pair.second = 0.; else pair.second /= adcSum; @@ -294,34 +297,34 @@ namespace { return simTrackIdToAdc; } - std::map chargeFraction(const SiStripCluster& cluster, const DetId& detId, + std::map chargeFraction(const SiStripCluster& cluster, + const DetId& detId, const edm::DetSetVector& digiSimLink) { std::map simTrackIdToAdc; auto idetset = digiSimLink.find(detId); - if(idetset == digiSimLink.end()) + if (idetset == digiSimLink.end()) return simTrackIdToAdc; double adcSum = 0; StripDigiSimLink found; - int first = cluster.firstStrip(); - for(size_t i=0; i chargeFraction(const Phase2TrackerCluster1D& cluster, const DetId& detId, + std::map chargeFraction(const Phase2TrackerCluster1D& cluster, + const DetId& detId, const edm::DetSetVector& digiSimLink) { std::map simTrackIdToAdc; throw cms::Exception("LogicError") << "Not possible to use StripDigiSimLink with Phase2TrackerCluster1D! "; @@ -330,7 +333,8 @@ namespace { //In the OT, there is no measurement of the charge, so no ADC value. //Only in the SSA chip (so in PSs) you have one "threshold" flag that tells you if the charge of at least one strip in the cluster exceeded 1.2 MIPs. - std::map chargeFraction(const Phase2TrackerCluster1D& cluster, const DetId& detId, + std::map chargeFraction(const Phase2TrackerCluster1D& cluster, + const DetId& detId, const edm::DetSetVector& digiSimLink) { std::map simTrackIdToAdc; return simTrackIdToAdc; @@ -349,16 +353,17 @@ namespace { size_t innermostHit = std::numeric_limits::max(); }; - std::vector clusters = track_associator::hitsToClusterRefs(track.recHitsBegin(), track.recHitsEnd()); + std::vector clusters = + track_associator::hitsToClusterRefs(track.recHitsBegin(), track.recHitsEnd()); std::unordered_map count; - for(size_t iCluster=0, end=clusters.size(); iClustersecond.key(); - if(tpKeyToIndex.find(tpKey) == tpKeyToIndex.end()) // filter out TPs not given as an input + if (tpKeyToIndex.find(tpKey) == tpKeyToIndex.end()) // filter out TPs not given as an input continue; auto& elem = count[tpKey]; @@ -370,11 +375,11 @@ namespace { // In case there are many matches with the same number of clusters, // select the one with innermost hit TrackTPMatch best; - int bestCount = 2; // require >= 3 cluster for the best match + int bestCount = 2; // require >= 3 cluster for the best match size_t bestInnermostHit = std::numeric_limits::max(); - for(auto& keyCount: count) { - if(keyCount.second.clusters > bestCount || - (keyCount.second.clusters == bestCount && keyCount.second.innermostHit < bestInnermostHit)) { + for (auto& keyCount : count) { + if (keyCount.second.clusters > bestCount || + (keyCount.second.clusters == bestCount && keyCount.second.innermostHit < bestInnermostHit)) { best.key = keyCount.first; best.countClusters = bestCount = keyCount.second.clusters; bestInnermostHit = keyCount.second.innermostHit; @@ -391,62 +396,60 @@ namespace { const TrackingParticleRefKeyToIndex& tpKeyToIndex) { TrackTPMatch best; - std::vector clusters = track_associator::hitsToClusterRefs(track.recHitsBegin(), track.recHitsEnd()); - if(clusters.empty()) { + std::vector clusters = + track_associator::hitsToClusterRefs(track.recHitsBegin(), track.recHitsEnd()); + if (clusters.empty()) { return best; } auto operateCluster = [&](const auto& clusterRef, const auto& func) { auto range = clusterToTPMap.equal_range(clusterRef); - for(auto ip=range.first; ip != range.second; ++ip) { + for (auto ip = range.first; ip != range.second; ++ip) { const auto tpKey = ip->second.key(); - if(tpKeyToIndex.find(tpKey) == tpKeyToIndex.end()) // filter out TPs not given as an input + if (tpKeyToIndex.find(tpKey) == tpKeyToIndex.end()) // filter out TPs not given as an input continue; func(tpKey); } }; - std::vector validTPs; // first cluster can be associated to multiple TPs, use vector as set as this should be small + std::vector + validTPs; // first cluster can be associated to multiple TPs, use vector as set as this should be small auto iCluster = clusters.begin(); - operateCluster(*iCluster, [&](unsigned int tpKey) { - validTPs.push_back(tpKey); - }); - if(validTPs.empty()) { + operateCluster(*iCluster, [&](unsigned int tpKey) { validTPs.push_back(tpKey); }); + if (validTPs.empty()) { return best; } ++iCluster; ++best.countClusters; std::vector foundTPs(validTPs.size(), false); - for(auto iEnd=clusters.end(); iCluster != iEnd; ++iCluster) { + for (auto iEnd = clusters.end(); iCluster != iEnd; ++iCluster) { const auto& clusterRef = *iCluster; // find out to which first-cluster TPs this cluster is matched to operateCluster(clusterRef, [&](unsigned int tpKey) { - auto found = std::find(cbegin(validTPs), cend(validTPs), tpKey); - if(found != cend(validTPs)) { - foundTPs[std::distance(cbegin(validTPs), found)] = true; - } - }); - + auto found = std::find(cbegin(validTPs), cend(validTPs), tpKey); + if (found != cend(validTPs)) { + foundTPs[std::distance(cbegin(validTPs), found)] = true; + } + }); // remove the non-found TPs auto iTP = validTPs.size(); do { --iTP; - if(!foundTPs[iTP]) { - validTPs.erase(validTPs.begin()+iTP); - foundTPs.erase(foundTPs.begin()+iTP); + if (!foundTPs[iTP]) { + validTPs.erase(validTPs.begin() + iTP); + foundTPs.erase(foundTPs.begin() + iTP); } - } while(iTP > 0); - if(!validTPs.empty()) { + } while (iTP > 0); + if (!validTPs.empty()) { // for multiple TPs the "first one" is a bit arbitrary, but // I hope it is rare that a track would have many // consecutive hits matched to two TPs best.key = validTPs[0]; - } - else { + } else { break; } @@ -457,7 +460,7 @@ namespace { // Reqquire >= 3 clusters for a match return best.countClusters >= 3 ? best : TrackTPMatch(); } -} +} // namespace // // class declaration @@ -470,38 +473,25 @@ class TrackingNtuple : public edm::one::EDAnalyzer { static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - private: void analyze(const edm::Event&, const edm::EventSetup&) override; void clearVariables(); - enum class HitType { - Pixel = 0, - Strip = 1, - Glued = 2, - Invalid = 3, - Phase2OT = 4, - Unknown = 99 - }; + enum class HitType { Pixel = 0, Strip = 1, Glued = 2, Invalid = 3, Phase2OT = 4, Unknown = 99 }; // This gives the "best" classification of a reco hit // In case of reco hit mathing to multiple sim, smaller number is // considered better // To be kept in synch with class HitSimType in ntuple.py - enum class HitSimType { - Signal = 0, - ITPileup = 1, - OOTPileup = 2, - Noise = 3, - Unknown = 99 - }; + enum class HitSimType { Signal = 0, ITPileup = 1, OOTPileup = 2, Noise = 3, Unknown = 99 }; using MVACollection = std::vector; using QualityMaskCollection = std::vector; struct TPHitIndex { - TPHitIndex(unsigned int tp=0, unsigned int simHit=0, float to=0, unsigned int id=0): tpKey(tp), simHitIdx(simHit), tof(to), detId(id) {} + TPHitIndex(unsigned int tp = 0, unsigned int simHit = 0, float to = 0, unsigned int id = 0) + : tpKey(tp), simHitIdx(simHit), tof(to), detId(id) {} unsigned int tpKey; unsigned int simHitIdx; float tof; @@ -509,11 +499,11 @@ class TrackingNtuple : public edm::one::EDAnalyzer { }; static bool tpHitIndexListLess(const TPHitIndex& i, const TPHitIndex& j) { return (i.tpKey < j.tpKey); } static bool tpHitIndexListLessSort(const TPHitIndex& i, const TPHitIndex& j) { - if(i.tpKey == j.tpKey) { - if(edm::isNotFinite(i.tof) && edm::isNotFinite(j.tof)) { + if (i.tpKey == j.tpKey) { + if (edm::isNotFinite(i.tof) && edm::isNotFinite(j.tof)) { return i.detId < j.detId; } - return i.tof < j.tof; // works as intended if either one is NaN + return i.tof < j.tof; // works as intended if either one is NaN } return i.tpKey < j.tpKey; } @@ -527,8 +517,7 @@ class TrackingNtuple : public edm::one::EDAnalyzer { const TransientTrackingRecHitBuilder& theTTRHBuilder, const TrackerTopology& tTopo, const SimHitRefKeyToIndex& simHitRefKeyToIndex, - std::set& hitProductIds - ); + std::set& hitProductIds); void fillStripRphiStereoHits(const edm::Event& iEvent, const ClusterTPAssociation& clusterToTPMap, @@ -538,20 +527,17 @@ class TrackingNtuple : public edm::one::EDAnalyzer { const TransientTrackingRecHitBuilder& theTTRHBuilder, const TrackerTopology& tTopo, const SimHitRefKeyToIndex& simHitRefKeyToIndex, - std::set& hitProductIds - ); + std::set& hitProductIds); void fillStripMatchedHits(const edm::Event& iEvent, const TransientTrackingRecHitBuilder& theTTRHBuilder, const TrackerTopology& tTopo, - std::vector >& monoStereoClusterList - ); + std::vector>& monoStereoClusterList); size_t addStripMatchedHit(const SiStripMatchedRecHit2D& hit, const TransientTrackingRecHitBuilder& theTTRHBuilder, const TrackerTopology& tTopo, - std::vector >& monoStereoClusterList - ); + std::vector>& monoStereoClusterList); void fillPhase2OTHits(const edm::Event& iEvent, const ClusterTPAssociation& clusterToTPMap, @@ -561,8 +547,7 @@ class TrackingNtuple : public edm::one::EDAnalyzer { const TransientTrackingRecHitBuilder& theTTRHBuilder, const TrackerTopology& tTopo, const SimHitRefKeyToIndex& simHitRefKeyToIndex, - std::set& hitProductIds - ); + std::set& hitProductIds); void fillSeeds(const edm::Event& iEvent, const TrackingParticleRefVector& tpCollection, @@ -573,10 +558,9 @@ class TrackingNtuple : public edm::one::EDAnalyzer { const TransientTrackingRecHitBuilder& theTTRHBuilder, const MagneticField& theMF, const TrackerTopology& tTopo, - std::vector >& monoStereoClusterList, + std::vector>& monoStereoClusterList, const std::set& hitProductIds, - std::map& seedToCollIndex - ); + std::map& seedToCollIndex); void fillTracks(const edm::RefToBaseVector& tracks, const TrackingParticleRefVector& tpCollection, @@ -591,9 +575,8 @@ class TrackingNtuple : public edm::one::EDAnalyzer { const TrackerTopology& tTopo, const std::set& hitProductIds, const std::map& seedToCollIndex, - const std::vector& mvaColls, - const std::vector& qualColls - ); + const std::vector& mvaColls, + const std::vector& qualColls); void fillSimHits(const TrackerGeometry& tracker, const TrackingParticleRefKeyToIndex& tpKeyToIndex, @@ -602,30 +585,25 @@ class TrackingNtuple : public edm::one::EDAnalyzer { SimHitRefKeyToIndex& simHitRefKeyToIndex, std::vector& tpHitList); - void fillTrackingParticles(const edm::Event& iEvent, const edm::EventSetup& iSetup, + void fillTrackingParticles(const edm::Event& iEvent, + const edm::EventSetup& iSetup, const edm::RefToBaseVector& tracks, const reco::BeamSpot& bs, const TrackingParticleRefVector& tpCollection, const TrackingVertexRefKeyToIndex& tvKeyToIndex, const reco::TrackToTrackingParticleAssociator& associatorByHits, const std::vector& tpHitList, - const TrackingParticleRefKeyToCount& tpKeyToClusterCount - ); + const TrackingParticleRefKeyToCount& tpKeyToClusterCount); void fillTrackingParticlesForSeeds(const TrackingParticleRefVector& tpCollection, const reco::SimToRecoCollection& simRecColl, const TrackingParticleRefKeyToIndex& tpKeyToIndex, - const unsigned int seedOffset - ); + const unsigned int seedOffset); - void fillVertices(const reco::VertexCollection& vertices, - const edm::RefToBaseVector& tracks); + void fillVertices(const reco::VertexCollection& vertices, const edm::RefToBaseVector& tracks); void fillTrackingVertices(const TrackingVertexRefVector& trackingVertices, - const TrackingParticleRefKeyToIndex& tpKeyToIndex - ); - - + const TrackingParticleRefKeyToIndex& tpKeyToIndex); struct SimHitData { std::vector matchingSimHit; @@ -637,29 +615,30 @@ class TrackingNtuple : public edm::one::EDAnalyzer { template SimHitData matchCluster(const OmniClusterRef& cluster, - DetId hitId, int clusterKey, + DetId hitId, + int clusterKey, const TransientTrackingRecHit::RecHitPointer& ttrh, const ClusterTPAssociation& clusterToTPMap, const TrackingParticleRefKeyToIndex& tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList& simHitsTPAssoc, const edm::DetSetVector& digiSimLinks, const SimHitRefKeyToIndex& simHitRefKeyToIndex, - HitType hitType - ); + HitType hitType); // ----------member data --------------------------- - std::vector > > seedTokens_; - std::vector > > seedStopInfoTokens_; - edm::EDGetTokenT > trackToken_; - std::vector, edm::EDGetTokenT > > mvaQualityCollectionTokens_; + std::vector>> seedTokens_; + std::vector>> seedStopInfoTokens_; + edm::EDGetTokenT> trackToken_; + std::vector, edm::EDGetTokenT>> + mvaQualityCollectionTokens_; edm::EDGetTokenT trackingParticleToken_; edm::EDGetTokenT trackingParticleRefToken_; edm::EDGetTokenT clusterTPMapToken_; edm::EDGetTokenT simHitTPMapToken_; edm::EDGetTokenT trackAssociatorToken_; - edm::EDGetTokenT > pixelSimLinkToken_; - edm::EDGetTokenT > stripSimLinkToken_; - edm::EDGetTokenT > siphase2OTSimLinksToken_; + edm::EDGetTokenT> pixelSimLinkToken_; + edm::EDGetTokenT> stripSimLinkToken_; + edm::EDGetTokenT> siphase2OTSimLinksToken_; bool includeStripHits_, includePhase2OTHits_; edm::EDGetTokenT beamSpotToken_; edm::EDGetTokenT pixelRecHitToken_; @@ -669,9 +648,9 @@ class TrackingNtuple : public edm::one::EDAnalyzer { edm::EDGetTokenT phase2OTRecHitToken_; edm::EDGetTokenT vertexToken_; edm::EDGetTokenT trackingVertexToken_; - edm::EDGetTokenT > tpNLayersToken_; - edm::EDGetTokenT > tpNPixelLayersToken_; - edm::EDGetTokenT > tpNStripStereoLayersToken_; + edm::EDGetTokenT> tpNLayersToken_; + edm::EDGetTokenT> tpNPixelLayersToken_; + edm::EDGetTokenT> tpNStripStereoLayersToken_; std::string builderName_; std::string parametersDefinerName_; const bool includeSeeds_; @@ -684,16 +663,14 @@ class TrackingNtuple : public edm::one::EDAnalyzer { TTree* t; // DetId branches -#define BOOK(name) tree->Branch((prefix+"_"+#name).c_str(), &name); +#define BOOK(name) tree->Branch((prefix + "_" + #name).c_str(), &name); class DetIdCommon { public: - DetIdCommon() {}; + DetIdCommon(){}; - unsigned int operator[](size_t i) const { - return detId[i]; - } + unsigned int operator[](size_t i) const { return detId[i]; } - void book(const std::string& prefix, TTree *tree) { + void book(const std::string& prefix, TTree* tree) { BOOK(detId); BOOK(subdet); BOOK(layer); @@ -702,21 +679,21 @@ class TrackingNtuple : public edm::one::EDAnalyzer { } void push_back(const TrackerTopology& tTopo, const DetId& id) { - detId .push_back(id.rawId() ); - subdet.push_back(id.subdetId() ); - layer .push_back(tTopo.layer(id) ); + detId.push_back(id.rawId()); + subdet.push_back(id.subdetId()); + layer.push_back(tTopo.layer(id)); module.push_back(tTopo.module(id)); unsigned short s = 0; - switch(id.subdetId()) { - case StripSubdetector::TIB: - s = tTopo.tibSide(id); - break; - case StripSubdetector::TOB: - s = tTopo.tobSide(id); - break; - default: - s = tTopo.side(id); + switch (id.subdetId()) { + case StripSubdetector::TIB: + s = tTopo.tibSide(id); + break; + case StripSubdetector::TOB: + s = tTopo.tobSide(id); + break; + default: + s = tTopo.side(id); } side.push_back(s); } @@ -730,10 +707,10 @@ class TrackingNtuple : public edm::one::EDAnalyzer { } void set(size_t index, const TrackerTopology& tTopo, const DetId& id) { - detId [index] = id.rawId(); + detId[index] = id.rawId(); subdet[index] = id.subdetId(); - layer [index] = tTopo.layer(id); - side [index] = tTopo.side(id); + layer[index] = tTopo.layer(id); + side[index] = tTopo.side(id); module[index] = tTopo.module(id); } @@ -748,7 +725,7 @@ class TrackingNtuple : public edm::one::EDAnalyzer { private: std::vector detId; std::vector subdet; - std::vector layer; // or disk/wheel + std::vector layer; // or disk/wheel std::vector side; std::vector module; }; @@ -757,7 +734,7 @@ class TrackingNtuple : public edm::one::EDAnalyzer { public: DetIdPixelOnly() {} - void book(const std::string& prefix, TTree *tree) { + void book(const std::string& prefix, TTree* tree) { BOOK(ladder); BOOK(blade); BOOK(panel); @@ -765,9 +742,9 @@ class TrackingNtuple : public edm::one::EDAnalyzer { void push_back(const TrackerTopology& tTopo, const DetId& id) { const bool isBarrel = id.subdetId() == PixelSubdetector::PixelBarrel; - ladder.push_back( isBarrel ? tTopo.pxbLadder(id) : 0 ); - blade .push_back( isBarrel ? 0 : tTopo.pxfBlade(id) ); - panel .push_back( isBarrel ? 0 : tTopo.pxfPanel(id) ); + ladder.push_back(isBarrel ? tTopo.pxbLadder(id) : 0); + blade.push_back(isBarrel ? 0 : tTopo.pxfBlade(id)); + panel.push_back(isBarrel ? 0 : tTopo.pxfPanel(id)); } void clear() { @@ -786,7 +763,7 @@ class TrackingNtuple : public edm::one::EDAnalyzer { public: DetIdOTCommon() {} - void book(const std::string& prefix, TTree *tree) { + void book(const std::string& prefix, TTree* tree) { BOOK(order); BOOK(ring); BOOK(rod); @@ -794,9 +771,9 @@ class TrackingNtuple : public edm::one::EDAnalyzer { void push_back(const TrackerTopology& tTopo, const DetId& id) { const auto parsed = parse(tTopo, id); - order .push_back(parsed.order ); - ring .push_back(parsed.ring ); - rod .push_back(parsed.rod ); + order.push_back(parsed.order); + ring.push_back(parsed.ring); + rod.push_back(parsed.rod); } void resize(size_t size) { @@ -805,11 +782,11 @@ class TrackingNtuple : public edm::one::EDAnalyzer { rod.resize(size); } - void set(size_t index, const TrackerTopology& tTopo, const DetId& id) { + void set(size_t index, const TrackerTopology& tTopo, const DetId& id) { const auto parsed = parse(tTopo, id); - order [index] = parsed.order ; - ring [index] = parsed.ring ; - rod [index] = parsed.rod ; + order[index] = parsed.order; + ring[index] = parsed.ring; + rod[index] = parsed.rod; } void clear() { @@ -827,17 +804,17 @@ class TrackingNtuple : public edm::one::EDAnalyzer { unsigned int rod = 0; }; Parsed parse(const TrackerTopology& tTopo, const DetId& id) const { - switch(id.subdetId()) { - case StripSubdetector::TIB: - return Parsed{tTopo.tibOrder(id), 0, 0}; - case StripSubdetector::TID: - return Parsed{tTopo.tidOrder(id), tTopo.tidRing(id), 0}; - case StripSubdetector::TOB: - return Parsed{0, 0, tTopo.tobRod(id)}; - case StripSubdetector::TEC: - return Parsed{tTopo.tecOrder(id), tTopo.tecRing(id), 0}; - default: - return Parsed{}; + switch (id.subdetId()) { + case StripSubdetector::TIB: + return Parsed{tTopo.tibOrder(id), 0, 0}; + case StripSubdetector::TID: + return Parsed{tTopo.tidOrder(id), tTopo.tidRing(id), 0}; + case StripSubdetector::TOB: + return Parsed{0, 0, tTopo.tobRod(id)}; + case StripSubdetector::TEC: + return Parsed{tTopo.tecOrder(id), tTopo.tecRing(id), 0}; + default: + return Parsed{}; }; } @@ -850,7 +827,7 @@ class TrackingNtuple : public edm::one::EDAnalyzer { public: DetIdStripOnly() {} - void book(const std::string& prefix, TTree *tree) { + void book(const std::string& prefix, TTree* tree) { BOOK(string); BOOK(petalNumber); BOOK(isStereo); @@ -860,28 +837,28 @@ class TrackingNtuple : public edm::one::EDAnalyzer { void push_back(const TrackerTopology& tTopo, const DetId& id) { const auto parsed = parse(tTopo, id); - string .push_back(parsed.string ); + string.push_back(parsed.string); petalNumber.push_back(parsed.petalNumber); - isStereo .push_back(tTopo.isStereo(id)); - isRPhi .push_back(tTopo.isRPhi(id)); - isGlued .push_back(parsed.glued); + isStereo.push_back(tTopo.isStereo(id)); + isRPhi.push_back(tTopo.isRPhi(id)); + isGlued.push_back(parsed.glued); } void resize(size_t size) { - string .resize(size); + string.resize(size); petalNumber.resize(size); - isStereo .resize(size); - isRPhi .resize(size); - isGlued .resize(size); + isStereo.resize(size); + isRPhi.resize(size); + isGlued.resize(size); } void set(size_t index, const TrackerTopology& tTopo, const DetId& id) { const auto parsed = parse(tTopo, id); - string [index] = parsed.string ; + string[index] = parsed.string; petalNumber[index] = parsed.petalNumber; - isStereo [index] = tTopo.isStereo(id); - isRPhi [index] = tTopo.isRPhi(id); - isGlued [index] = parsed.glued; + isStereo[index] = tTopo.isStereo(id); + isRPhi[index] = tTopo.isRPhi(id); + isGlued[index] = parsed.glued; } void clear() { @@ -901,17 +878,17 @@ class TrackingNtuple : public edm::one::EDAnalyzer { bool glued = false; }; Parsed parse(const TrackerTopology& tTopo, const DetId& id) const { - switch(id.subdetId()) { - case StripSubdetector::TIB: - return Parsed{tTopo.tibString(id), 0, tTopo.tibIsDoubleSide(id)}; - case StripSubdetector::TID: - return Parsed{0, 0, tTopo.tidIsDoubleSide(id)}; - case StripSubdetector::TOB: - return Parsed{0, 0, tTopo.tobIsDoubleSide(id)}; - case StripSubdetector::TEC: - return Parsed{0, tTopo.tecPetalNumber(id), tTopo.tecIsDoubleSide(id)}; - default: - return Parsed{}; + switch (id.subdetId()) { + case StripSubdetector::TIB: + return Parsed{tTopo.tibString(id), 0, tTopo.tibIsDoubleSide(id)}; + case StripSubdetector::TID: + return Parsed{0, 0, tTopo.tidIsDoubleSide(id)}; + case StripSubdetector::TOB: + return Parsed{0, 0, tTopo.tobIsDoubleSide(id)}; + case StripSubdetector::TEC: + return Parsed{0, tTopo.tecPetalNumber(id), tTopo.tecIsDoubleSide(id)}; + default: + return Parsed{}; } } @@ -926,7 +903,7 @@ class TrackingNtuple : public edm::one::EDAnalyzer { public: DetIdPhase2OTOnly() {} - void book(const std::string& prefix, TTree *tree) { + void book(const std::string& prefix, TTree* tree) { BOOK(isLower); BOOK(isUpper); BOOK(isStack); @@ -935,7 +912,8 @@ class TrackingNtuple : public edm::one::EDAnalyzer { void push_back(const TrackerTopology& tTopo, const DetId& id) { isLower.push_back(tTopo.isLower(id)); isUpper.push_back(tTopo.isUpper(id)); - isStack.push_back(tTopo.stack(id) == 0); // equivalent to *IsDoubleSide() but without the hardcoded layer+ring requirements + isStack.push_back(tTopo.stack(id) == + 0); // equivalent to *IsDoubleSide() but without the hardcoded layer+ring requirements } void clear() { @@ -965,63 +943,63 @@ class TrackingNtuple : public edm::one::EDAnalyzer { //////////////////// // tracks // (first) index runs through tracks - std::vector trk_px ; - std::vector trk_py ; - std::vector trk_pz ; - std::vector trk_pt ; - std::vector trk_inner_px ; - std::vector trk_inner_py ; - std::vector trk_inner_pz ; - std::vector trk_inner_pt ; - std::vector trk_outer_px ; - std::vector trk_outer_py ; - std::vector trk_outer_pz ; - std::vector trk_outer_pt ; - std::vector trk_eta ; - std::vector trk_lambda ; - std::vector trk_cotTheta ; - std::vector trk_phi ; - std::vector trk_dxy ; - std::vector trk_dz ; - std::vector trk_dxyPV ; - std::vector trk_dzPV ; + std::vector trk_px; + std::vector trk_py; + std::vector trk_pz; + std::vector trk_pt; + std::vector trk_inner_px; + std::vector trk_inner_py; + std::vector trk_inner_pz; + std::vector trk_inner_pt; + std::vector trk_outer_px; + std::vector trk_outer_py; + std::vector trk_outer_pz; + std::vector trk_outer_pt; + std::vector trk_eta; + std::vector trk_lambda; + std::vector trk_cotTheta; + std::vector trk_phi; + std::vector trk_dxy; + std::vector trk_dz; + std::vector trk_dxyPV; + std::vector trk_dzPV; std::vector trk_dxyClosestPV; std::vector trk_dzClosestPV; - std::vector trk_ptErr ; - std::vector trk_etaErr ; + std::vector trk_ptErr; + std::vector trk_etaErr; std::vector trk_lambdaErr; - std::vector trk_phiErr ; - std::vector trk_dxyErr ; - std::vector trk_dzErr ; + std::vector trk_phiErr; + std::vector trk_dxyErr; + std::vector trk_dzErr; std::vector trk_refpoint_x; std::vector trk_refpoint_y; std::vector trk_refpoint_z; - std::vector trk_nChi2 ; + std::vector trk_nChi2; std::vector trk_nChi2_1Dmod; - std::vector trk_ndof ; + std::vector trk_ndof; std::vector> trk_mvas; std::vector> trk_qualityMasks; - std::vector trk_q ; - std::vector trk_nValid ; + std::vector trk_q; + std::vector trk_nValid; std::vector trk_nLost; std::vector trk_nInactive; - std::vector trk_nPixel ; - std::vector trk_nStrip ; + std::vector trk_nPixel; + std::vector trk_nStrip; std::vector trk_nOuterLost; std::vector trk_nInnerLost; std::vector trk_nOuterInactive; std::vector trk_nInnerInactive; std::vector trk_nPixelLay; std::vector trk_nStripLay; - std::vector trk_n3DLay ; + std::vector trk_n3DLay; std::vector trk_nLostLay; std::vector trk_nCluster; - std::vector trk_algo ; + std::vector trk_algo; std::vector trk_originalAlgo; std::vector trk_algoMask; std::vector trk_stopReason; - std::vector trk_isHP ; - std::vector trk_seedIdx ; + std::vector trk_isHP; + std::vector trk_seedIdx; std::vector trk_vtxIdx; std::vector trk_isTrue; std::vector trk_bestSimTrkIdx; @@ -1034,133 +1012,137 @@ class TrackingNtuple : public edm::one::EDAnalyzer { std::vector trk_bestFromFirstHitSimTrkShareFracSimDenom; std::vector trk_bestFromFirstHitSimTrkShareFracSimClusterDenom; std::vector trk_bestFromFirstHitSimTrkNChi2; - std::vector > trk_simTrkShareFrac; // second index runs through matched TrackingParticles - std::vector > trk_simTrkNChi2; // second index runs through matched TrackingParticles - std::vector > trk_simTrkIdx; // second index runs through matched TrackingParticles - std::vector > trk_hitIdx; // second index runs through hits - std::vector > trk_hitType; // second index runs through hits + std::vector> trk_simTrkShareFrac; // second index runs through matched TrackingParticles + std::vector> trk_simTrkNChi2; // second index runs through matched TrackingParticles + std::vector> trk_simTrkIdx; // second index runs through matched TrackingParticles + std::vector> trk_hitIdx; // second index runs through hits + std::vector> trk_hitType; // second index runs through hits //////////////////// // sim tracks // (first) index runs through TrackingParticles - std::vector sim_event ; - std::vector sim_bunchCrossing; - std::vector sim_pdgId ; - std::vector >sim_genPdgIds; - std::vector sim_isFromBHadron; - std::vector sim_px ; - std::vector sim_py ; - std::vector sim_pz ; - std::vector sim_pt ; - std::vector sim_eta ; - std::vector sim_phi ; - std::vector sim_pca_pt ; - std::vector sim_pca_eta ; + std::vector sim_event; + std::vector sim_bunchCrossing; + std::vector sim_pdgId; + std::vector> sim_genPdgIds; + std::vector sim_isFromBHadron; + std::vector sim_px; + std::vector sim_py; + std::vector sim_pz; + std::vector sim_pt; + std::vector sim_eta; + std::vector sim_phi; + std::vector sim_pca_pt; + std::vector sim_pca_eta; std::vector sim_pca_lambda; std::vector sim_pca_cotTheta; - std::vector sim_pca_phi ; - std::vector sim_pca_dxy ; - std::vector sim_pca_dz ; - std::vector sim_q ; + std::vector sim_pca_phi; + std::vector sim_pca_dxy; + std::vector sim_pca_dz; + std::vector sim_q; // numbers of sim hits/layers - std::vector sim_nValid ; - std::vector sim_nPixel ; - std::vector sim_nStrip ; + std::vector sim_nValid; + std::vector sim_nPixel; + std::vector sim_nStrip; std::vector sim_nLay; std::vector sim_nPixelLay; - std::vector sim_n3DLay ; + std::vector sim_n3DLay; // number of sim hits as calculated in TrackingTruthAccumulator std::vector sim_nTrackerHits; // number of clusters associated to TP std::vector sim_nRecoClusters; // links to other objects - std::vector > sim_trkIdx; // second index runs through matched tracks - std::vector > sim_trkShareFrac; // second index runs through matched tracks - std::vector > sim_seedIdx; // second index runs through matched seeds + std::vector> sim_trkIdx; // second index runs through matched tracks + std::vector> sim_trkShareFrac; // second index runs through matched tracks + std::vector> sim_seedIdx; // second index runs through matched seeds std::vector sim_parentVtxIdx; - std::vector > sim_decayVtxIdx; // second index runs through decay vertices - std::vector > sim_simHitIdx; // second index runs through SimHits + std::vector> sim_decayVtxIdx; // second index runs through decay vertices + std::vector> sim_simHitIdx; // second index runs through SimHits //////////////////// // pixel hits // (first) index runs through hits - std::vector pix_isBarrel ; + std::vector pix_isBarrel; DetIdPixel pix_detId; - std::vector > pix_trkIdx; // second index runs through tracks containing this hit - std::vector > pix_seeIdx; // second index runs through seeds containing this hit - std::vector > pix_simHitIdx; // second index runs through SimHits inducing this hit - std::vector > pix_chargeFraction; // second index runs through SimHits inducing this hit + std::vector> pix_trkIdx; // second index runs through tracks containing this hit + std::vector> pix_seeIdx; // second index runs through seeds containing this hit + std::vector> pix_simHitIdx; // second index runs through SimHits inducing this hit + std::vector> pix_chargeFraction; // second index runs through SimHits inducing this hit std::vector pix_simType; - std::vector pix_x ; - std::vector pix_y ; - std::vector pix_z ; - std::vector pix_xx ; - std::vector pix_xy ; - std::vector pix_yy ; - std::vector pix_yz ; - std::vector pix_zz ; - std::vector pix_zx ; - std::vector pix_radL ; //http://cmslxr.fnal.gov/lxr/source/DataFormats/GeometrySurface/interface/MediumProperties.h - std::vector pix_bbxi ; + std::vector pix_x; + std::vector pix_y; + std::vector pix_z; + std::vector pix_xx; + std::vector pix_xy; + std::vector pix_yy; + std::vector pix_yz; + std::vector pix_zz; + std::vector pix_zx; + std::vector + pix_radL; //http://cmslxr.fnal.gov/lxr/source/DataFormats/GeometrySurface/interface/MediumProperties.h + std::vector pix_bbxi; //////////////////// // strip hits // (first) index runs through hits - std::vector str_isBarrel ; + std::vector str_isBarrel; DetIdStrip str_detId; - std::vector > str_trkIdx; // second index runs through tracks containing this hit - std::vector > str_seeIdx; // second index runs through seeds containing this hit - std::vector > str_simHitIdx; // second index runs through SimHits inducing this hit - std::vector > str_chargeFraction; // second index runs through SimHits inducing this hit + std::vector> str_trkIdx; // second index runs through tracks containing this hit + std::vector> str_seeIdx; // second index runs through seeds containing this hit + std::vector> str_simHitIdx; // second index runs through SimHits inducing this hit + std::vector> str_chargeFraction; // second index runs through SimHits inducing this hit std::vector str_simType; - std::vector str_x ; - std::vector str_y ; - std::vector str_z ; - std::vector str_xx ; - std::vector str_xy ; - std::vector str_yy ; - std::vector str_yz ; - std::vector str_zz ; - std::vector str_zx ; - std::vector str_radL ; //http://cmslxr.fnal.gov/lxr/source/DataFormats/GeometrySurface/interface/MediumProperties.h - std::vector str_bbxi ; + std::vector str_x; + std::vector str_y; + std::vector str_z; + std::vector str_xx; + std::vector str_xy; + std::vector str_yy; + std::vector str_yz; + std::vector str_zz; + std::vector str_zx; + std::vector + str_radL; //http://cmslxr.fnal.gov/lxr/source/DataFormats/GeometrySurface/interface/MediumProperties.h + std::vector str_bbxi; //////////////////// // strip matched hits // (first) index runs through hits - std::vector glu_isBarrel ; + std::vector glu_isBarrel; DetIdStrip glu_detId; - std::vector glu_monoIdx ; + std::vector glu_monoIdx; std::vector glu_stereoIdx; - std::vector > glu_seeIdx; // second index runs through seeds containing this hit - std::vector glu_x ; - std::vector glu_y ; - std::vector glu_z ; - std::vector glu_xx ; - std::vector glu_xy ; - std::vector glu_yy ; - std::vector glu_yz ; - std::vector glu_zz ; - std::vector glu_zx ; - std::vector glu_radL ; //http://cmslxr.fnal.gov/lxr/source/DataFormats/GeometrySurface/interface/MediumProperties.h - std::vector glu_bbxi ; + std::vector> glu_seeIdx; // second index runs through seeds containing this hit + std::vector glu_x; + std::vector glu_y; + std::vector glu_z; + std::vector glu_xx; + std::vector glu_xy; + std::vector glu_yy; + std::vector glu_yz; + std::vector glu_zz; + std::vector glu_zx; + std::vector + glu_radL; //http://cmslxr.fnal.gov/lxr/source/DataFormats/GeometrySurface/interface/MediumProperties.h + std::vector glu_bbxi; //////////////////// // phase2 Outer Tracker hits // (first) index runs through hits - std::vector ph2_isBarrel ; + std::vector ph2_isBarrel; DetIdPhase2OT ph2_detId; - std::vector > ph2_trkIdx; // second index runs through tracks containing this hit - std::vector > ph2_seeIdx; // second index runs through seeds containing this hit - std::vector > ph2_simHitIdx; // second index runs through SimHits inducing this hit + std::vector> ph2_trkIdx; // second index runs through tracks containing this hit + std::vector> ph2_seeIdx; // second index runs through seeds containing this hit + std::vector> ph2_simHitIdx; // second index runs through SimHits inducing this hit //std::vector > ph2_chargeFraction; // Not supported at the moment for Phase2 std::vector ph2_simType; - std::vector ph2_x ; - std::vector ph2_y ; - std::vector ph2_z ; - std::vector ph2_xx ; - std::vector ph2_xy ; - std::vector ph2_yy ; - std::vector ph2_yz ; - std::vector ph2_zz ; - std::vector ph2_zx ; - std::vector ph2_radL ; //http://cmslxr.fnal.gov/lxr/source/DataFormats/GeometrySurface/interface/MediumProperties.h - std::vector ph2_bbxi ; + std::vector ph2_x; + std::vector ph2_y; + std::vector ph2_z; + std::vector ph2_xx; + std::vector ph2_xy; + std::vector ph2_yy; + std::vector ph2_yz; + std::vector ph2_zz; + std::vector ph2_zx; + std::vector + ph2_radL; //http://cmslxr.fnal.gov/lxr/source/DataFormats/GeometrySurface/interface/MediumProperties.h + std::vector ph2_bbxi; //////////////////// // invalid (missing/inactive/etc) hits @@ -1183,8 +1165,8 @@ class TrackingNtuple : public edm::one::EDAnalyzer { std::vector simhit_tof; //std::vector simhit_simTrackId; // can be useful for debugging, but not much of general interest std::vector simhit_simTrkIdx; - std::vector > simhit_hitIdx; // second index runs through induced reco hits - std::vector > simhit_hitType; // second index runs through induced reco hits + std::vector> simhit_hitIdx; // second index runs through induced reco hits + std::vector> simhit_hitType; // second index runs through induced reco hits //////////////////// // beam spot float bsp_x; @@ -1196,35 +1178,35 @@ class TrackingNtuple : public edm::one::EDAnalyzer { //////////////////// // seeds // (first) index runs through seeds - std::vector see_fitok ; - std::vector see_px ; - std::vector see_py ; - std::vector see_pz ; - std::vector see_pt ; - std::vector see_eta ; - std::vector see_phi ; - std::vector see_dxy ; - std::vector see_dz ; - std::vector see_ptErr ; - std::vector see_etaErr ; - std::vector see_phiErr ; - std::vector see_dxyErr ; - std::vector see_dzErr ; - std::vector see_chi2 ; + std::vector see_fitok; + std::vector see_px; + std::vector see_py; + std::vector see_pz; + std::vector see_pt; + std::vector see_eta; + std::vector see_phi; + std::vector see_dxy; + std::vector see_dz; + std::vector see_ptErr; + std::vector see_etaErr; + std::vector see_phiErr; + std::vector see_dxyErr; + std::vector see_dzErr; + std::vector see_chi2; std::vector see_statePt; std::vector see_stateTrajX; std::vector see_stateTrajY; std::vector see_stateTrajPx; std::vector see_stateTrajPy; std::vector see_stateTrajPz; - std::vector see_q ; - std::vector see_nValid ; - std::vector see_nPixel ; - std::vector see_nGlued ; - std::vector see_nStrip ; + std::vector see_q; + std::vector see_nValid; + std::vector see_nPixel; + std::vector see_nGlued; + std::vector see_nStrip; std::vector see_nPhase2OT; std::vector see_nCluster; - std::vector see_algo ; + std::vector see_algo; std::vector see_stopReason; std::vector see_nCands; std::vector see_trkIdx; @@ -1233,13 +1215,12 @@ class TrackingNtuple : public edm::one::EDAnalyzer { std::vector see_bestSimTrkShareFrac; std::vector see_bestFromFirstHitSimTrkIdx; std::vector see_bestFromFirstHitSimTrkShareFrac; - std::vector > see_simTrkShareFrac; // second index runs through matched TrackingParticles - std::vector > see_simTrkIdx; // second index runs through matched TrackingParticles - std::vector > see_hitIdx; // second index runs through hits - std::vector > see_hitType; // second index runs through hits + std::vector> see_simTrkShareFrac; // second index runs through matched TrackingParticles + std::vector> see_simTrkIdx; // second index runs through matched TrackingParticles + std::vector> see_hitIdx; // second index runs through hits + std::vector> see_hitType; // second index runs through hits //seed algo offset, index runs through iterations - std::vector see_offset ; - + std::vector see_offset; //////////////////// // Vertices @@ -1254,181 +1235,196 @@ class TrackingNtuple : public edm::one::EDAnalyzer { std::vector vtx_chi2; std::vector vtx_fake; std::vector vtx_valid; - std::vector > vtx_trkIdx; // second index runs through tracks used in the vertex fit + std::vector> vtx_trkIdx; // second index runs through tracks used in the vertex fit //////////////////// // Tracking vertices // (first) index runs through TrackingVertices - std::vector simvtx_event; - std::vector simvtx_bunchCrossing; - std::vector simvtx_processType; // only from first SimVertex of TrackingVertex + std::vector simvtx_event; + std::vector simvtx_bunchCrossing; + std::vector simvtx_processType; // only from first SimVertex of TrackingVertex std::vector simvtx_x; std::vector simvtx_y; std::vector simvtx_z; - std::vector > simvtx_sourceSimIdx; // second index runs through source TrackingParticles - std::vector > simvtx_daughterSimIdx; // second index runs through daughter TrackingParticles + std::vector> simvtx_sourceSimIdx; // second index runs through source TrackingParticles + std::vector> simvtx_daughterSimIdx; // second index runs through daughter TrackingParticles std::vector simpv_idx; }; // // constructors and destructor // -TrackingNtuple::TrackingNtuple(const edm::ParameterSet& iConfig): - trackToken_(consumes >(iConfig.getUntrackedParameter("tracks"))), - clusterTPMapToken_(consumes(iConfig.getUntrackedParameter("clusterTPMap"))), - simHitTPMapToken_(consumes(iConfig.getUntrackedParameter("simHitTPMap"))), - trackAssociatorToken_(consumes(iConfig.getUntrackedParameter("trackAssociator"))), - pixelSimLinkToken_(consumes >(iConfig.getUntrackedParameter("pixelDigiSimLink"))), - stripSimLinkToken_(consumes >(iConfig.getUntrackedParameter("stripDigiSimLink"))), - siphase2OTSimLinksToken_(consumes >(iConfig.getUntrackedParameter("phase2OTSimLink"))), - includeStripHits_(iConfig.getUntrackedParameter("stripDigiSimLink").label() != ""), - includePhase2OTHits_(iConfig.getUntrackedParameter("phase2OTSimLink").label() != ""), - beamSpotToken_(consumes(iConfig.getUntrackedParameter("beamSpot"))), - pixelRecHitToken_(consumes(iConfig.getUntrackedParameter("pixelRecHits"))), - stripRphiRecHitToken_(consumes(iConfig.getUntrackedParameter("stripRphiRecHits"))), - stripStereoRecHitToken_(consumes(iConfig.getUntrackedParameter("stripStereoRecHits"))), - stripMatchedRecHitToken_(consumes(iConfig.getUntrackedParameter("stripMatchedRecHits"))), - phase2OTRecHitToken_(consumes(iConfig.getUntrackedParameter("phase2OTRecHits"))), - vertexToken_(consumes(iConfig.getUntrackedParameter("vertices"))), - trackingVertexToken_(consumes(iConfig.getUntrackedParameter("trackingVertices"))), - tpNLayersToken_(consumes >(iConfig.getUntrackedParameter("trackingParticleNlayers"))), - tpNPixelLayersToken_(consumes >(iConfig.getUntrackedParameter("trackingParticleNpixellayers"))), - tpNStripStereoLayersToken_(consumes >(iConfig.getUntrackedParameter("trackingParticleNstripstereolayers"))), - builderName_(iConfig.getUntrackedParameter("TTRHBuilder")), - parametersDefinerName_(iConfig.getUntrackedParameter("parametersDefiner")), - includeSeeds_(iConfig.getUntrackedParameter("includeSeeds")), - includeAllHits_(iConfig.getUntrackedParameter("includeAllHits")), - includeMVA_(iConfig.getUntrackedParameter("includeMVA")), - includeTrackingParticles_(iConfig.getUntrackedParameter("includeTrackingParticles")) -{ - if(includeSeeds_) { - seedTokens_ = edm::vector_transform(iConfig.getUntrackedParameter >("seedTracks"), [&](const edm::InputTag& tag) { - return consumes >(tag); - }); - seedStopInfoTokens_ = edm::vector_transform(iConfig.getUntrackedParameter >("trackCandidates"), [&](const edm::InputTag& tag) { - return consumes >(tag); - }); - if(seedTokens_.size() != seedStopInfoTokens_.size()) { - throw cms::Exception("Configuration") << "Got " << seedTokens_.size() << " seed collections, but " << seedStopInfoTokens_.size() << " track candidate collections"; +TrackingNtuple::TrackingNtuple(const edm::ParameterSet& iConfig) + : trackToken_(consumes>(iConfig.getUntrackedParameter("tracks"))), + clusterTPMapToken_(consumes(iConfig.getUntrackedParameter("clusterTPMap"))), + simHitTPMapToken_(consumes( + iConfig.getUntrackedParameter("simHitTPMap"))), + trackAssociatorToken_(consumes( + iConfig.getUntrackedParameter("trackAssociator"))), + pixelSimLinkToken_(consumes>( + iConfig.getUntrackedParameter("pixelDigiSimLink"))), + stripSimLinkToken_(consumes>( + iConfig.getUntrackedParameter("stripDigiSimLink"))), + siphase2OTSimLinksToken_(consumes>( + iConfig.getUntrackedParameter("phase2OTSimLink"))), + includeStripHits_(!iConfig.getUntrackedParameter("stripDigiSimLink").label().empty()), + includePhase2OTHits_(!iConfig.getUntrackedParameter("phase2OTSimLink").label().empty()), + beamSpotToken_(consumes(iConfig.getUntrackedParameter("beamSpot"))), + pixelRecHitToken_( + consumes(iConfig.getUntrackedParameter("pixelRecHits"))), + stripRphiRecHitToken_( + consumes(iConfig.getUntrackedParameter("stripRphiRecHits"))), + stripStereoRecHitToken_( + consumes(iConfig.getUntrackedParameter("stripStereoRecHits"))), + stripMatchedRecHitToken_(consumes( + iConfig.getUntrackedParameter("stripMatchedRecHits"))), + phase2OTRecHitToken_(consumes( + iConfig.getUntrackedParameter("phase2OTRecHits"))), + vertexToken_(consumes(iConfig.getUntrackedParameter("vertices"))), + trackingVertexToken_( + consumes(iConfig.getUntrackedParameter("trackingVertices"))), + tpNLayersToken_(consumes>( + iConfig.getUntrackedParameter("trackingParticleNlayers"))), + tpNPixelLayersToken_(consumes>( + iConfig.getUntrackedParameter("trackingParticleNpixellayers"))), + tpNStripStereoLayersToken_(consumes>( + iConfig.getUntrackedParameter("trackingParticleNstripstereolayers"))), + builderName_(iConfig.getUntrackedParameter("TTRHBuilder")), + parametersDefinerName_(iConfig.getUntrackedParameter("parametersDefiner")), + includeSeeds_(iConfig.getUntrackedParameter("includeSeeds")), + includeAllHits_(iConfig.getUntrackedParameter("includeAllHits")), + includeMVA_(iConfig.getUntrackedParameter("includeMVA")), + includeTrackingParticles_(iConfig.getUntrackedParameter("includeTrackingParticles")) { + if (includeSeeds_) { + seedTokens_ = + edm::vector_transform(iConfig.getUntrackedParameter>("seedTracks"), + [&](const edm::InputTag& tag) { return consumes>(tag); }); + seedStopInfoTokens_ = + edm::vector_transform(iConfig.getUntrackedParameter>("trackCandidates"), + [&](const edm::InputTag& tag) { return consumes>(tag); }); + if (seedTokens_.size() != seedStopInfoTokens_.size()) { + throw cms::Exception("Configuration") << "Got " << seedTokens_.size() << " seed collections, but " + << seedStopInfoTokens_.size() << " track candidate collections"; } } - if(includeAllHits_) { - if(includeStripHits_ && includePhase2OTHits_) { - throw cms::Exception("Configuration") << "Both stripDigiSimLink and phase2OTSimLink are set, please set only either one (this information is used to infer if you're running phase0/1 or phase2 detector)"; + if (includeAllHits_) { + if (includeStripHits_ && includePhase2OTHits_) { + throw cms::Exception("Configuration") + << "Both stripDigiSimLink and phase2OTSimLink are set, please set only either one (this information is used " + "to infer if you're running phase0/1 or phase2 detector)"; } - if(!includeStripHits_ && !includePhase2OTHits_) { - throw cms::Exception("Configuration") << "Neither stripDigiSimLink or phase2OTSimLink are set, please set either one."; + if (!includeStripHits_ && !includePhase2OTHits_) { + throw cms::Exception("Configuration") + << "Neither stripDigiSimLink or phase2OTSimLink are set, please set either one."; } } const bool tpRef = iConfig.getUntrackedParameter("trackingParticlesRef"); const auto tpTag = iConfig.getUntrackedParameter("trackingParticles"); - if(tpRef) { + if (tpRef) { trackingParticleRefToken_ = consumes(tpTag); - } - else { + } else { trackingParticleToken_ = consumes(tpTag); } - tracer_.depth(-2); // as in SimTracker/TrackHistory/src/TrackClassifier.cc + tracer_.depth(-2); // as in SimTracker/TrackHistory/src/TrackClassifier.cc - if(includeMVA_) { - mvaQualityCollectionTokens_ = edm::vector_transform(iConfig.getUntrackedParameter >("trackMVAs"), - [&](const std::string& tag) { - return std::make_tuple(consumes(edm::InputTag(tag, "MVAValues")), - consumes(edm::InputTag(tag, "QualityMasks"))); - }); + if (includeMVA_) { + mvaQualityCollectionTokens_ = edm::vector_transform( + iConfig.getUntrackedParameter>("trackMVAs"), [&](const std::string& tag) { + return std::make_tuple(consumes(edm::InputTag(tag, "MVAValues")), + consumes(edm::InputTag(tag, "QualityMasks"))); + }); } usesResource(TFileService::kSharedResource); edm::Service fs; - t = fs->make("tree","tree"); + t = fs->make("tree", "tree"); - t->Branch("event" , &ev_event); - t->Branch("lumi" , &ev_lumi); - t->Branch("run" , &ev_run); + t->Branch("event", &ev_event); + t->Branch("lumi", &ev_lumi); + t->Branch("run", &ev_run); //tracks - t->Branch("trk_px" , &trk_px); - t->Branch("trk_py" , &trk_py); - t->Branch("trk_pz" , &trk_pz); - t->Branch("trk_pt" , &trk_pt); - t->Branch("trk_inner_px" , &trk_inner_px); - t->Branch("trk_inner_py" , &trk_inner_py); - t->Branch("trk_inner_pz" , &trk_inner_pz); - t->Branch("trk_inner_pt" , &trk_inner_pt); - t->Branch("trk_outer_px" , &trk_outer_px); - t->Branch("trk_outer_py" , &trk_outer_py); - t->Branch("trk_outer_pz" , &trk_outer_pz); - t->Branch("trk_outer_pt" , &trk_outer_pt); - t->Branch("trk_eta" , &trk_eta); - t->Branch("trk_lambda" , &trk_lambda); - t->Branch("trk_cotTheta" , &trk_cotTheta); - t->Branch("trk_phi" , &trk_phi); - t->Branch("trk_dxy" , &trk_dxy ); - t->Branch("trk_dz" , &trk_dz ); - t->Branch("trk_dxyPV" , &trk_dxyPV ); - t->Branch("trk_dzPV" , &trk_dzPV ); - t->Branch("trk_dxyClosestPV", &trk_dxyClosestPV ); - t->Branch("trk_dzClosestPV", &trk_dzClosestPV ); - t->Branch("trk_ptErr" , &trk_ptErr ); - t->Branch("trk_etaErr" , &trk_etaErr ); + t->Branch("trk_px", &trk_px); + t->Branch("trk_py", &trk_py); + t->Branch("trk_pz", &trk_pz); + t->Branch("trk_pt", &trk_pt); + t->Branch("trk_inner_px", &trk_inner_px); + t->Branch("trk_inner_py", &trk_inner_py); + t->Branch("trk_inner_pz", &trk_inner_pz); + t->Branch("trk_inner_pt", &trk_inner_pt); + t->Branch("trk_outer_px", &trk_outer_px); + t->Branch("trk_outer_py", &trk_outer_py); + t->Branch("trk_outer_pz", &trk_outer_pz); + t->Branch("trk_outer_pt", &trk_outer_pt); + t->Branch("trk_eta", &trk_eta); + t->Branch("trk_lambda", &trk_lambda); + t->Branch("trk_cotTheta", &trk_cotTheta); + t->Branch("trk_phi", &trk_phi); + t->Branch("trk_dxy", &trk_dxy); + t->Branch("trk_dz", &trk_dz); + t->Branch("trk_dxyPV", &trk_dxyPV); + t->Branch("trk_dzPV", &trk_dzPV); + t->Branch("trk_dxyClosestPV", &trk_dxyClosestPV); + t->Branch("trk_dzClosestPV", &trk_dzClosestPV); + t->Branch("trk_ptErr", &trk_ptErr); + t->Branch("trk_etaErr", &trk_etaErr); t->Branch("trk_lambdaErr", &trk_lambdaErr); - t->Branch("trk_phiErr" , &trk_phiErr ); - t->Branch("trk_dxyErr" , &trk_dxyErr ); - t->Branch("trk_dzErr" , &trk_dzErr ); + t->Branch("trk_phiErr", &trk_phiErr); + t->Branch("trk_dxyErr", &trk_dxyErr); + t->Branch("trk_dzErr", &trk_dzErr); t->Branch("trk_refpoint_x", &trk_refpoint_x); t->Branch("trk_refpoint_y", &trk_refpoint_y); t->Branch("trk_refpoint_z", &trk_refpoint_z); - t->Branch("trk_nChi2" , &trk_nChi2); + t->Branch("trk_nChi2", &trk_nChi2); t->Branch("trk_nChi2_1Dmod", &trk_nChi2_1Dmod); - t->Branch("trk_ndof" , &trk_ndof); - if(includeMVA_) { + t->Branch("trk_ndof", &trk_ndof); + if (includeMVA_) { trk_mvas.resize(mvaQualityCollectionTokens_.size()); trk_qualityMasks.resize(mvaQualityCollectionTokens_.size()); - if(!trk_mvas.empty()) { - t->Branch("trk_mva" , &(trk_mvas[0])); + if (!trk_mvas.empty()) { + t->Branch("trk_mva", &(trk_mvas[0])); t->Branch("trk_qualityMask", &(trk_qualityMasks[0])); - for(size_t i=1; iBranch(("trk_mva"+std::to_string(i+1)).c_str(), &(trk_mvas[i])); - t->Branch(("trk_qualityMask"+std::to_string(i+1)).c_str(), &(trk_qualityMasks[i])); + for (size_t i = 1; i < trk_mvas.size(); ++i) { + t->Branch(("trk_mva" + std::to_string(i + 1)).c_str(), &(trk_mvas[i])); + t->Branch(("trk_qualityMask" + std::to_string(i + 1)).c_str(), &(trk_qualityMasks[i])); } } } - t->Branch("trk_q" , &trk_q); - t->Branch("trk_nValid" , &trk_nValid ); - t->Branch("trk_nLost" , &trk_nLost); + t->Branch("trk_q", &trk_q); + t->Branch("trk_nValid", &trk_nValid); + t->Branch("trk_nLost", &trk_nLost); t->Branch("trk_nInactive", &trk_nInactive); - t->Branch("trk_nPixel" , &trk_nPixel ); - t->Branch("trk_nStrip" , &trk_nStrip ); + t->Branch("trk_nPixel", &trk_nPixel); + t->Branch("trk_nStrip", &trk_nStrip); t->Branch("trk_nOuterLost", &trk_nOuterLost); t->Branch("trk_nInnerLost", &trk_nInnerLost); t->Branch("trk_nOuterInactive", &trk_nOuterInactive); t->Branch("trk_nInnerInactive", &trk_nInnerInactive); t->Branch("trk_nPixelLay", &trk_nPixelLay); t->Branch("trk_nStripLay", &trk_nStripLay); - t->Branch("trk_n3DLay" , &trk_n3DLay ); - t->Branch("trk_nLostLay" , &trk_nLostLay ); - t->Branch("trk_nCluster" , &trk_nCluster); - t->Branch("trk_algo" , &trk_algo ); + t->Branch("trk_n3DLay", &trk_n3DLay); + t->Branch("trk_nLostLay", &trk_nLostLay); + t->Branch("trk_nCluster", &trk_nCluster); + t->Branch("trk_algo", &trk_algo); t->Branch("trk_originalAlgo", &trk_originalAlgo); - t->Branch("trk_algoMask" , &trk_algoMask); + t->Branch("trk_algoMask", &trk_algoMask); t->Branch("trk_stopReason", &trk_stopReason); - t->Branch("trk_isHP" , &trk_isHP ); - if(includeSeeds_) { - t->Branch("trk_seedIdx" , &trk_seedIdx ); + t->Branch("trk_isHP", &trk_isHP); + if (includeSeeds_) { + t->Branch("trk_seedIdx", &trk_seedIdx); } - t->Branch("trk_vtxIdx" , &trk_vtxIdx); - if(includeTrackingParticles_) { - t->Branch("trk_simTrkIdx", &trk_simTrkIdx ); + t->Branch("trk_vtxIdx", &trk_vtxIdx); + if (includeTrackingParticles_) { + t->Branch("trk_simTrkIdx", &trk_simTrkIdx); t->Branch("trk_simTrkShareFrac", &trk_simTrkShareFrac); t->Branch("trk_simTrkNChi2", &trk_simTrkNChi2); t->Branch("trk_bestSimTrkIdx", &trk_bestSimTrkIdx); t->Branch("trk_bestFromFirstHitSimTrkIdx", &trk_bestFromFirstHitSimTrkIdx); - } - else { - t->Branch("trk_isTrue", &trk_isTrue); + } else { + t->Branch("trk_isTrue", &trk_isTrue); } t->Branch("trk_bestSimTrkShareFrac", &trk_bestSimTrkShareFrac); t->Branch("trk_bestSimTrkShareFracSimDenom", &trk_bestSimTrkShareFracSimDenom); @@ -1438,333 +1434,333 @@ TrackingNtuple::TrackingNtuple(const edm::ParameterSet& iConfig): t->Branch("trk_bestFromFirstHitSimTrkShareFracSimDenom", &trk_bestFromFirstHitSimTrkShareFracSimDenom); t->Branch("trk_bestFromFirstHitSimTrkShareFracSimClusterDenom", &trk_bestFromFirstHitSimTrkShareFracSimClusterDenom); t->Branch("trk_bestFromFirstHitSimTrkNChi2", &trk_bestFromFirstHitSimTrkNChi2); - if(includeAllHits_) { - t->Branch("trk_hitIdx" , &trk_hitIdx); + if (includeAllHits_) { + t->Branch("trk_hitIdx", &trk_hitIdx); t->Branch("trk_hitType", &trk_hitType); } - if(includeTrackingParticles_) { + if (includeTrackingParticles_) { //sim tracks - t->Branch("sim_event" , &sim_event ); + t->Branch("sim_event", &sim_event); t->Branch("sim_bunchCrossing", &sim_bunchCrossing); - t->Branch("sim_pdgId" , &sim_pdgId ); + t->Branch("sim_pdgId", &sim_pdgId); t->Branch("sim_genPdgIds", &sim_genPdgIds); t->Branch("sim_isFromBHadron", &sim_isFromBHadron); - t->Branch("sim_px" , &sim_px ); - t->Branch("sim_py" , &sim_py ); - t->Branch("sim_pz" , &sim_pz ); - t->Branch("sim_pt" , &sim_pt ); - t->Branch("sim_eta" , &sim_eta ); - t->Branch("sim_phi" , &sim_phi ); - t->Branch("sim_pca_pt" , &sim_pca_pt ); - t->Branch("sim_pca_eta" , &sim_pca_eta ); + t->Branch("sim_px", &sim_px); + t->Branch("sim_py", &sim_py); + t->Branch("sim_pz", &sim_pz); + t->Branch("sim_pt", &sim_pt); + t->Branch("sim_eta", &sim_eta); + t->Branch("sim_phi", &sim_phi); + t->Branch("sim_pca_pt", &sim_pca_pt); + t->Branch("sim_pca_eta", &sim_pca_eta); t->Branch("sim_pca_lambda", &sim_pca_lambda); t->Branch("sim_pca_cotTheta", &sim_pca_cotTheta); - t->Branch("sim_pca_phi" , &sim_pca_phi ); - t->Branch("sim_pca_dxy" , &sim_pca_dxy ); - t->Branch("sim_pca_dz" , &sim_pca_dz ); - t->Branch("sim_q" , &sim_q ); - t->Branch("sim_nValid" , &sim_nValid ); - t->Branch("sim_nPixel" , &sim_nPixel ); - t->Branch("sim_nStrip" , &sim_nStrip ); - t->Branch("sim_nLay" , &sim_nLay ); + t->Branch("sim_pca_phi", &sim_pca_phi); + t->Branch("sim_pca_dxy", &sim_pca_dxy); + t->Branch("sim_pca_dz", &sim_pca_dz); + t->Branch("sim_q", &sim_q); + t->Branch("sim_nValid", &sim_nValid); + t->Branch("sim_nPixel", &sim_nPixel); + t->Branch("sim_nStrip", &sim_nStrip); + t->Branch("sim_nLay", &sim_nLay); t->Branch("sim_nPixelLay", &sim_nPixelLay); - t->Branch("sim_n3DLay" , &sim_n3DLay ); + t->Branch("sim_n3DLay", &sim_n3DLay); t->Branch("sim_nTrackerHits", &sim_nTrackerHits); t->Branch("sim_nRecoClusters", &sim_nRecoClusters); - t->Branch("sim_trkIdx" , &sim_trkIdx ); + t->Branch("sim_trkIdx", &sim_trkIdx); t->Branch("sim_trkShareFrac", &sim_trkShareFrac); - if(includeSeeds_) { - t->Branch("sim_seedIdx" , &sim_seedIdx ); + if (includeSeeds_) { + t->Branch("sim_seedIdx", &sim_seedIdx); } t->Branch("sim_parentVtxIdx", &sim_parentVtxIdx); t->Branch("sim_decayVtxIdx", &sim_decayVtxIdx); - if(includeAllHits_) { - t->Branch("sim_simHitIdx" , &sim_simHitIdx ); + if (includeAllHits_) { + t->Branch("sim_simHitIdx", &sim_simHitIdx); } } - if(includeAllHits_) { + if (includeAllHits_) { //pixels - t->Branch("pix_isBarrel" , &pix_isBarrel ); + t->Branch("pix_isBarrel", &pix_isBarrel); pix_detId.book("pix", t); - t->Branch("pix_trkIdx" , &pix_trkIdx ); - if(includeSeeds_) { - t->Branch("pix_seeIdx" , &pix_seeIdx ); + t->Branch("pix_trkIdx", &pix_trkIdx); + if (includeSeeds_) { + t->Branch("pix_seeIdx", &pix_seeIdx); } - if(includeTrackingParticles_) { - t->Branch("pix_simHitIdx" , &pix_simHitIdx); + if (includeTrackingParticles_) { + t->Branch("pix_simHitIdx", &pix_simHitIdx); t->Branch("pix_chargeFraction", &pix_chargeFraction); t->Branch("pix_simType", &pix_simType); } - t->Branch("pix_x" , &pix_x ); - t->Branch("pix_y" , &pix_y ); - t->Branch("pix_z" , &pix_z ); - t->Branch("pix_xx" , &pix_xx ); - t->Branch("pix_xy" , &pix_xy ); - t->Branch("pix_yy" , &pix_yy ); - t->Branch("pix_yz" , &pix_yz ); - t->Branch("pix_zz" , &pix_zz ); - t->Branch("pix_zx" , &pix_zx ); - t->Branch("pix_radL" , &pix_radL ); - t->Branch("pix_bbxi" , &pix_bbxi ); - t->Branch("pix_bbxi" , &pix_bbxi ); + t->Branch("pix_x", &pix_x); + t->Branch("pix_y", &pix_y); + t->Branch("pix_z", &pix_z); + t->Branch("pix_xx", &pix_xx); + t->Branch("pix_xy", &pix_xy); + t->Branch("pix_yy", &pix_yy); + t->Branch("pix_yz", &pix_yz); + t->Branch("pix_zz", &pix_zz); + t->Branch("pix_zx", &pix_zx); + t->Branch("pix_radL", &pix_radL); + t->Branch("pix_bbxi", &pix_bbxi); + t->Branch("pix_bbxi", &pix_bbxi); //strips - if(includeStripHits_){ - t->Branch("str_isBarrel" , &str_isBarrel ); + if (includeStripHits_) { + t->Branch("str_isBarrel", &str_isBarrel); str_detId.book("str", t); - t->Branch("str_trkIdx" , &str_trkIdx ); - if(includeSeeds_) { - t->Branch("str_seeIdx" , &str_seeIdx ); + t->Branch("str_trkIdx", &str_trkIdx); + if (includeSeeds_) { + t->Branch("str_seeIdx", &str_seeIdx); } - if(includeTrackingParticles_) { - t->Branch("str_simHitIdx" , &str_simHitIdx); + if (includeTrackingParticles_) { + t->Branch("str_simHitIdx", &str_simHitIdx); t->Branch("str_chargeFraction", &str_chargeFraction); t->Branch("str_simType", &str_simType); } - t->Branch("str_x" , &str_x ); - t->Branch("str_y" , &str_y ); - t->Branch("str_z" , &str_z ); - t->Branch("str_xx" , &str_xx ); - t->Branch("str_xy" , &str_xy ); - t->Branch("str_yy" , &str_yy ); - t->Branch("str_yz" , &str_yz ); - t->Branch("str_zz" , &str_zz ); - t->Branch("str_zx" , &str_zx ); - t->Branch("str_radL" , &str_radL ); - t->Branch("str_bbxi" , &str_bbxi ); + t->Branch("str_x", &str_x); + t->Branch("str_y", &str_y); + t->Branch("str_z", &str_z); + t->Branch("str_xx", &str_xx); + t->Branch("str_xy", &str_xy); + t->Branch("str_yy", &str_yy); + t->Branch("str_yz", &str_yz); + t->Branch("str_zz", &str_zz); + t->Branch("str_zx", &str_zx); + t->Branch("str_radL", &str_radL); + t->Branch("str_bbxi", &str_bbxi); //matched hits - t->Branch("glu_isBarrel" , &glu_isBarrel ); + t->Branch("glu_isBarrel", &glu_isBarrel); glu_detId.book("glu", t); - t->Branch("glu_monoIdx" , &glu_monoIdx ); - t->Branch("glu_stereoIdx" , &glu_stereoIdx); - if(includeSeeds_) { - t->Branch("glu_seeIdx" , &glu_seeIdx ); + t->Branch("glu_monoIdx", &glu_monoIdx); + t->Branch("glu_stereoIdx", &glu_stereoIdx); + if (includeSeeds_) { + t->Branch("glu_seeIdx", &glu_seeIdx); } - t->Branch("glu_x" , &glu_x ); - t->Branch("glu_y" , &glu_y ); - t->Branch("glu_z" , &glu_z ); - t->Branch("glu_xx" , &glu_xx ); - t->Branch("glu_xy" , &glu_xy ); - t->Branch("glu_yy" , &glu_yy ); - t->Branch("glu_yz" , &glu_yz ); - t->Branch("glu_zz" , &glu_zz ); - t->Branch("glu_zx" , &glu_zx ); - t->Branch("glu_radL" , &glu_radL ); - t->Branch("glu_bbxi" , &glu_bbxi ); + t->Branch("glu_x", &glu_x); + t->Branch("glu_y", &glu_y); + t->Branch("glu_z", &glu_z); + t->Branch("glu_xx", &glu_xx); + t->Branch("glu_xy", &glu_xy); + t->Branch("glu_yy", &glu_yy); + t->Branch("glu_yz", &glu_yz); + t->Branch("glu_zz", &glu_zz); + t->Branch("glu_zx", &glu_zx); + t->Branch("glu_radL", &glu_radL); + t->Branch("glu_bbxi", &glu_bbxi); } //phase2 OT - if(includePhase2OTHits_){ - t->Branch("ph2_isBarrel" , &ph2_isBarrel ); + if (includePhase2OTHits_) { + t->Branch("ph2_isBarrel", &ph2_isBarrel); ph2_detId.book("ph2", t); - t->Branch("ph2_trkIdx" , &ph2_trkIdx ); - if(includeSeeds_) { - t->Branch("ph2_seeIdx" , &ph2_seeIdx ); + t->Branch("ph2_trkIdx", &ph2_trkIdx); + if (includeSeeds_) { + t->Branch("ph2_seeIdx", &ph2_seeIdx); } - if(includeTrackingParticles_) { - t->Branch("ph2_simHitIdx" , &ph2_simHitIdx); + if (includeTrackingParticles_) { + t->Branch("ph2_simHitIdx", &ph2_simHitIdx); t->Branch("ph2_simType", &ph2_simType); } - t->Branch("ph2_x" , &ph2_x ); - t->Branch("ph2_y" , &ph2_y ); - t->Branch("ph2_z" , &ph2_z ); - t->Branch("ph2_xx" , &ph2_xx ); - t->Branch("ph2_xy" , &ph2_xy ); - t->Branch("ph2_yy" , &ph2_yy ); - t->Branch("ph2_yz" , &ph2_yz ); - t->Branch("ph2_zz" , &ph2_zz ); - t->Branch("ph2_zx" , &ph2_zx ); - t->Branch("ph2_radL" , &ph2_radL ); - t->Branch("ph2_bbxi" , &ph2_bbxi ); - t->Branch("ph2_bbxi" , &ph2_bbxi ); + t->Branch("ph2_x", &ph2_x); + t->Branch("ph2_y", &ph2_y); + t->Branch("ph2_z", &ph2_z); + t->Branch("ph2_xx", &ph2_xx); + t->Branch("ph2_xy", &ph2_xy); + t->Branch("ph2_yy", &ph2_yy); + t->Branch("ph2_yz", &ph2_yz); + t->Branch("ph2_zz", &ph2_zz); + t->Branch("ph2_zx", &ph2_zx); + t->Branch("ph2_radL", &ph2_radL); + t->Branch("ph2_bbxi", &ph2_bbxi); + t->Branch("ph2_bbxi", &ph2_bbxi); } //invalid hits - t->Branch("inv_isBarrel" , &inv_isBarrel ); - if(includeStripHits_) inv_detId.book("inv", t); - else inv_detId_phase2.book("inv", t); - t->Branch("inv_type" , &inv_type ); + t->Branch("inv_isBarrel", &inv_isBarrel); + if (includeStripHits_) + inv_detId.book("inv", t); + else + inv_detId_phase2.book("inv", t); + t->Branch("inv_type", &inv_type); //simhits - if(includeTrackingParticles_) { - if(includeStripHits_) simhit_detId.book("simhit", t); - else simhit_detId_phase2.book("simhit", t); - t->Branch("simhit_x" , &simhit_x); - t->Branch("simhit_y" , &simhit_y); - t->Branch("simhit_z" , &simhit_z); - t->Branch("simhit_particle", &simhit_particle); - t->Branch("simhit_process" , &simhit_process); - t->Branch("simhit_eloss" , &simhit_eloss); - t->Branch("simhit_tof" , &simhit_tof); + if (includeTrackingParticles_) { + if (includeStripHits_) + simhit_detId.book("simhit", t); + else + simhit_detId_phase2.book("simhit", t); + t->Branch("simhit_x", &simhit_x); + t->Branch("simhit_y", &simhit_y); + t->Branch("simhit_z", &simhit_z); + t->Branch("simhit_particle", &simhit_particle); + t->Branch("simhit_process", &simhit_process); + t->Branch("simhit_eloss", &simhit_eloss); + t->Branch("simhit_tof", &simhit_tof); t->Branch("simhit_simTrkIdx", &simhit_simTrkIdx); - t->Branch("simhit_hitIdx" , &simhit_hitIdx); - t->Branch("simhit_hitType" , &simhit_hitType); + t->Branch("simhit_hitIdx", &simhit_hitIdx); + t->Branch("simhit_hitType", &simhit_hitType); } } //beam spot - t->Branch("bsp_x" , &bsp_x , "bsp_x/F"); - t->Branch("bsp_y" , &bsp_y , "bsp_y/F"); - t->Branch("bsp_z" , &bsp_z , "bsp_z/F"); - t->Branch("bsp_sigmax" , &bsp_sigmax , "bsp_sigmax/F"); - t->Branch("bsp_sigmay" , &bsp_sigmay , "bsp_sigmay/F"); - t->Branch("bsp_sigmaz" , &bsp_sigmaz , "bsp_sigmaz/F"); - if(includeSeeds_) { + t->Branch("bsp_x", &bsp_x, "bsp_x/F"); + t->Branch("bsp_y", &bsp_y, "bsp_y/F"); + t->Branch("bsp_z", &bsp_z, "bsp_z/F"); + t->Branch("bsp_sigmax", &bsp_sigmax, "bsp_sigmax/F"); + t->Branch("bsp_sigmay", &bsp_sigmay, "bsp_sigmay/F"); + t->Branch("bsp_sigmaz", &bsp_sigmaz, "bsp_sigmaz/F"); + if (includeSeeds_) { //seeds - t->Branch("see_fitok" , &see_fitok ); - t->Branch("see_px" , &see_px ); - t->Branch("see_py" , &see_py ); - t->Branch("see_pz" , &see_pz ); - t->Branch("see_pt" , &see_pt ); - t->Branch("see_eta" , &see_eta ); - t->Branch("see_phi" , &see_phi ); - t->Branch("see_dxy" , &see_dxy ); - t->Branch("see_dz" , &see_dz ); - t->Branch("see_ptErr" , &see_ptErr ); - t->Branch("see_etaErr" , &see_etaErr ); - t->Branch("see_phiErr" , &see_phiErr ); - t->Branch("see_dxyErr" , &see_dxyErr ); - t->Branch("see_dzErr" , &see_dzErr ); - t->Branch("see_chi2" , &see_chi2 ); - t->Branch("see_statePt" , &see_statePt ); + t->Branch("see_fitok", &see_fitok); + t->Branch("see_px", &see_px); + t->Branch("see_py", &see_py); + t->Branch("see_pz", &see_pz); + t->Branch("see_pt", &see_pt); + t->Branch("see_eta", &see_eta); + t->Branch("see_phi", &see_phi); + t->Branch("see_dxy", &see_dxy); + t->Branch("see_dz", &see_dz); + t->Branch("see_ptErr", &see_ptErr); + t->Branch("see_etaErr", &see_etaErr); + t->Branch("see_phiErr", &see_phiErr); + t->Branch("see_dxyErr", &see_dxyErr); + t->Branch("see_dzErr", &see_dzErr); + t->Branch("see_chi2", &see_chi2); + t->Branch("see_statePt", &see_statePt); t->Branch("see_stateTrajX", &see_stateTrajX); t->Branch("see_stateTrajY", &see_stateTrajY); t->Branch("see_stateTrajPx", &see_stateTrajPx); t->Branch("see_stateTrajPy", &see_stateTrajPy); t->Branch("see_stateTrajPz", &see_stateTrajPz); - t->Branch("see_q" , &see_q ); - t->Branch("see_nValid" , &see_nValid ); - t->Branch("see_nPixel" , &see_nPixel ); - t->Branch("see_nGlued" , &see_nGlued ); - t->Branch("see_nStrip" , &see_nStrip ); + t->Branch("see_q", &see_q); + t->Branch("see_nValid", &see_nValid); + t->Branch("see_nPixel", &see_nPixel); + t->Branch("see_nGlued", &see_nGlued); + t->Branch("see_nStrip", &see_nStrip); t->Branch("see_nPhase2OT", &see_nPhase2OT); - t->Branch("see_nCluster" , &see_nCluster); - t->Branch("see_algo" , &see_algo ); + t->Branch("see_nCluster", &see_nCluster); + t->Branch("see_algo", &see_algo); t->Branch("see_stopReason", &see_stopReason); - t->Branch("see_nCands" , &see_nCands ); - t->Branch("see_trkIdx" , &see_trkIdx ); - if(includeTrackingParticles_) { - t->Branch("see_simTrkIdx", &see_simTrkIdx ); + t->Branch("see_nCands", &see_nCands); + t->Branch("see_trkIdx", &see_trkIdx); + if (includeTrackingParticles_) { + t->Branch("see_simTrkIdx", &see_simTrkIdx); t->Branch("see_simTrkShareFrac", &see_simTrkShareFrac); t->Branch("see_bestSimTrkIdx", &see_bestSimTrkIdx); t->Branch("see_bestFromFirstHitSimTrkIdx", &see_bestFromFirstHitSimTrkIdx); - } - else { + } else { t->Branch("see_isTrue", &see_isTrue); } t->Branch("see_bestSimTrkShareFrac", &see_bestSimTrkShareFrac); t->Branch("see_bestFromFirstHitSimTrkShareFrac", &see_bestFromFirstHitSimTrkShareFrac); - if(includeAllHits_) { - t->Branch("see_hitIdx" , &see_hitIdx ); - t->Branch("see_hitType", &see_hitType ); + if (includeAllHits_) { + t->Branch("see_hitIdx", &see_hitIdx); + t->Branch("see_hitType", &see_hitType); } //seed algo offset - t->Branch("see_offset" , &see_offset ); + t->Branch("see_offset", &see_offset); } //vertices - t->Branch("vtx_x" , &vtx_x); - t->Branch("vtx_y" , &vtx_y); - t->Branch("vtx_z" , &vtx_z); - t->Branch("vtx_xErr" , &vtx_xErr); - t->Branch("vtx_yErr" , &vtx_yErr); - t->Branch("vtx_zErr" , &vtx_zErr); - t->Branch("vtx_ndof" , &vtx_ndof); - t->Branch("vtx_chi2" , &vtx_chi2); - t->Branch("vtx_fake" , &vtx_fake); - t->Branch("vtx_valid" , &vtx_valid); - t->Branch("vtx_trkIdx" , &vtx_trkIdx); + t->Branch("vtx_x", &vtx_x); + t->Branch("vtx_y", &vtx_y); + t->Branch("vtx_z", &vtx_z); + t->Branch("vtx_xErr", &vtx_xErr); + t->Branch("vtx_yErr", &vtx_yErr); + t->Branch("vtx_zErr", &vtx_zErr); + t->Branch("vtx_ndof", &vtx_ndof); + t->Branch("vtx_chi2", &vtx_chi2); + t->Branch("vtx_fake", &vtx_fake); + t->Branch("vtx_valid", &vtx_valid); + t->Branch("vtx_trkIdx", &vtx_trkIdx); // tracking vertices - t->Branch("simvtx_event" , &simvtx_event ); + t->Branch("simvtx_event", &simvtx_event); t->Branch("simvtx_bunchCrossing", &simvtx_bunchCrossing); t->Branch("simvtx_processType", &simvtx_processType); - t->Branch("simvtx_x" , &simvtx_x); - t->Branch("simvtx_y" , &simvtx_y); - t->Branch("simvtx_z" , &simvtx_z); + t->Branch("simvtx_x", &simvtx_x); + t->Branch("simvtx_y", &simvtx_y); + t->Branch("simvtx_z", &simvtx_z); t->Branch("simvtx_sourceSimIdx", &simvtx_sourceSimIdx); t->Branch("simvtx_daughterSimIdx", &simvtx_daughterSimIdx); - t->Branch("simpv_idx" , &simpv_idx); + t->Branch("simpv_idx", &simpv_idx); //t->Branch("" , &); } - TrackingNtuple::~TrackingNtuple() { // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) } - // // member functions // void TrackingNtuple::clearVariables() { - ev_run = 0; ev_lumi = 0; ev_event = 0; //tracks - trk_px .clear(); - trk_py .clear(); - trk_pz .clear(); - trk_pt .clear(); - trk_inner_px .clear(); - trk_inner_py .clear(); - trk_inner_pz .clear(); - trk_inner_pt .clear(); - trk_outer_px .clear(); - trk_outer_py .clear(); - trk_outer_pz .clear(); - trk_outer_pt .clear(); - trk_eta .clear(); - trk_lambda .clear(); - trk_cotTheta .clear(); - trk_phi .clear(); - trk_dxy .clear(); - trk_dz .clear(); - trk_dxyPV .clear(); - trk_dzPV .clear(); + trk_px.clear(); + trk_py.clear(); + trk_pz.clear(); + trk_pt.clear(); + trk_inner_px.clear(); + trk_inner_py.clear(); + trk_inner_pz.clear(); + trk_inner_pt.clear(); + trk_outer_px.clear(); + trk_outer_py.clear(); + trk_outer_pz.clear(); + trk_outer_pt.clear(); + trk_eta.clear(); + trk_lambda.clear(); + trk_cotTheta.clear(); + trk_phi.clear(); + trk_dxy.clear(); + trk_dz.clear(); + trk_dxyPV.clear(); + trk_dzPV.clear(); trk_dxyClosestPV.clear(); trk_dzClosestPV.clear(); - trk_ptErr .clear(); - trk_etaErr .clear(); + trk_ptErr.clear(); + trk_etaErr.clear(); trk_lambdaErr.clear(); - trk_phiErr .clear(); - trk_dxyErr .clear(); - trk_dzErr .clear(); + trk_phiErr.clear(); + trk_dxyErr.clear(); + trk_dzErr.clear(); trk_refpoint_x.clear(); trk_refpoint_y.clear(); trk_refpoint_z.clear(); - trk_nChi2 .clear(); + trk_nChi2.clear(); trk_nChi2_1Dmod.clear(); - trk_ndof .clear(); - for(auto& mva: trk_mvas) { + trk_ndof.clear(); + for (auto& mva : trk_mvas) { mva.clear(); } - for(auto& mask: trk_qualityMasks) { + for (auto& mask : trk_qualityMasks) { mask.clear(); } - trk_q .clear(); - trk_nValid .clear(); - trk_nLost .clear(); + trk_q.clear(); + trk_nValid.clear(); + trk_nLost.clear(); trk_nInactive.clear(); - trk_nPixel .clear(); - trk_nStrip .clear(); + trk_nPixel.clear(); + trk_nStrip.clear(); trk_nOuterLost.clear(); trk_nInnerLost.clear(); trk_nOuterInactive.clear(); trk_nInnerInactive.clear(); trk_nPixelLay.clear(); trk_nStripLay.clear(); - trk_n3DLay .clear(); - trk_nLostLay .clear(); - trk_nCluster .clear(); - trk_algo .clear(); + trk_n3DLay.clear(); + trk_nLostLay.clear(); + trk_nCluster.clear(); + trk_algo.clear(); trk_originalAlgo.clear(); - trk_algoMask .clear(); + trk_algoMask.clear(); trk_stopReason.clear(); - trk_isHP .clear(); - trk_seedIdx .clear(); - trk_vtxIdx .clear(); - trk_isTrue .clear(); + trk_isHP.clear(); + trk_seedIdx.clear(); + trk_vtxIdx.clear(); + trk_isTrue.clear(); trk_bestSimTrkIdx.clear(); trk_bestSimTrkShareFrac.clear(); trk_bestSimTrkShareFracSimDenom.clear(); @@ -1778,120 +1774,120 @@ void TrackingNtuple::clearVariables() { trk_simTrkIdx.clear(); trk_simTrkShareFrac.clear(); trk_simTrkNChi2.clear(); - trk_hitIdx .clear(); - trk_hitType .clear(); + trk_hitIdx.clear(); + trk_hitType.clear(); //sim tracks - sim_event .clear(); + sim_event.clear(); sim_bunchCrossing.clear(); - sim_pdgId .clear(); + sim_pdgId.clear(); sim_genPdgIds.clear(); sim_isFromBHadron.clear(); - sim_px .clear(); - sim_py .clear(); - sim_pz .clear(); - sim_pt .clear(); - sim_eta .clear(); - sim_phi .clear(); - sim_pca_pt .clear(); - sim_pca_eta .clear(); + sim_px.clear(); + sim_py.clear(); + sim_pz.clear(); + sim_pt.clear(); + sim_eta.clear(); + sim_phi.clear(); + sim_pca_pt.clear(); + sim_pca_eta.clear(); sim_pca_lambda.clear(); sim_pca_cotTheta.clear(); - sim_pca_phi .clear(); - sim_pca_dxy .clear(); - sim_pca_dz .clear(); - sim_q .clear(); - sim_nValid .clear(); - sim_nPixel .clear(); - sim_nStrip .clear(); - sim_nLay .clear(); + sim_pca_phi.clear(); + sim_pca_dxy.clear(); + sim_pca_dz.clear(); + sim_q.clear(); + sim_nValid.clear(); + sim_nPixel.clear(); + sim_nStrip.clear(); + sim_nLay.clear(); sim_nPixelLay.clear(); - sim_n3DLay .clear(); + sim_n3DLay.clear(); sim_nTrackerHits.clear(); sim_nRecoClusters.clear(); - sim_trkIdx .clear(); - sim_seedIdx .clear(); + sim_trkIdx.clear(); + sim_seedIdx.clear(); sim_trkShareFrac.clear(); sim_parentVtxIdx.clear(); sim_decayVtxIdx.clear(); - sim_simHitIdx .clear(); + sim_simHitIdx.clear(); //pixels - pix_isBarrel .clear(); - pix_detId .clear(); - pix_trkIdx .clear(); - pix_seeIdx .clear(); + pix_isBarrel.clear(); + pix_detId.clear(); + pix_trkIdx.clear(); + pix_seeIdx.clear(); pix_simHitIdx.clear(); pix_chargeFraction.clear(); pix_simType.clear(); - pix_x .clear(); - pix_y .clear(); - pix_z .clear(); - pix_xx .clear(); - pix_xy .clear(); - pix_yy .clear(); - pix_yz .clear(); - pix_zz .clear(); - pix_zx .clear(); - pix_radL .clear(); - pix_bbxi .clear(); + pix_x.clear(); + pix_y.clear(); + pix_z.clear(); + pix_xx.clear(); + pix_xy.clear(); + pix_yy.clear(); + pix_yz.clear(); + pix_zz.clear(); + pix_zx.clear(); + pix_radL.clear(); + pix_bbxi.clear(); //strips - str_isBarrel .clear(); - str_detId .clear(); - str_trkIdx .clear(); - str_seeIdx .clear(); + str_isBarrel.clear(); + str_detId.clear(); + str_trkIdx.clear(); + str_seeIdx.clear(); str_simHitIdx.clear(); str_chargeFraction.clear(); str_simType.clear(); - str_x .clear(); - str_y .clear(); - str_z .clear(); - str_xx .clear(); - str_xy .clear(); - str_yy .clear(); - str_yz .clear(); - str_zz .clear(); - str_zx .clear(); - str_radL .clear(); - str_bbxi .clear(); + str_x.clear(); + str_y.clear(); + str_z.clear(); + str_xx.clear(); + str_xy.clear(); + str_yy.clear(); + str_yz.clear(); + str_zz.clear(); + str_zx.clear(); + str_radL.clear(); + str_bbxi.clear(); //matched hits - glu_isBarrel .clear(); - glu_detId .clear(); - glu_monoIdx .clear(); + glu_isBarrel.clear(); + glu_detId.clear(); + glu_monoIdx.clear(); glu_stereoIdx.clear(); - glu_seeIdx .clear(); - glu_x .clear(); - glu_y .clear(); - glu_z .clear(); - glu_xx .clear(); - glu_xy .clear(); - glu_yy .clear(); - glu_yz .clear(); - glu_zz .clear(); - glu_zx .clear(); - glu_radL .clear(); - glu_bbxi .clear(); + glu_seeIdx.clear(); + glu_x.clear(); + glu_y.clear(); + glu_z.clear(); + glu_xx.clear(); + glu_xy.clear(); + glu_yy.clear(); + glu_yz.clear(); + glu_zz.clear(); + glu_zx.clear(); + glu_radL.clear(); + glu_bbxi.clear(); //phase2 OT - ph2_isBarrel .clear(); - ph2_detId .clear(); - ph2_trkIdx .clear(); - ph2_seeIdx .clear(); + ph2_isBarrel.clear(); + ph2_detId.clear(); + ph2_trkIdx.clear(); + ph2_seeIdx.clear(); ph2_simHitIdx.clear(); ph2_simType.clear(); - ph2_x .clear(); - ph2_y .clear(); - ph2_z .clear(); - ph2_xx .clear(); - ph2_xy .clear(); - ph2_yy .clear(); - ph2_yz .clear(); - ph2_zz .clear(); - ph2_zx .clear(); - ph2_radL .clear(); - ph2_bbxi .clear(); + ph2_x.clear(); + ph2_y.clear(); + ph2_z.clear(); + ph2_xx.clear(); + ph2_xy.clear(); + ph2_yy.clear(); + ph2_yz.clear(); + ph2_zz.clear(); + ph2_zx.clear(); + ph2_radL.clear(); + ph2_bbxi.clear(); //invalid hits - inv_isBarrel .clear(); - inv_detId .clear(); + inv_isBarrel.clear(); + inv_detId.clear(); inv_detId_phase2.clear(); - inv_type .clear(); + inv_type.clear(); // simhits simhit_detId.clear(); simhit_detId_phase2.clear(); @@ -1914,46 +1910,46 @@ void TrackingNtuple::clearVariables() { bsp_sigmay = -9999.; bsp_sigmaz = -9999.; //seeds - see_fitok .clear(); - see_px .clear(); - see_py .clear(); - see_pz .clear(); - see_pt .clear(); - see_eta .clear(); - see_phi .clear(); - see_dxy .clear(); - see_dz .clear(); - see_ptErr .clear(); - see_etaErr .clear(); - see_phiErr .clear(); - see_dxyErr .clear(); - see_dzErr .clear(); - see_chi2 .clear(); + see_fitok.clear(); + see_px.clear(); + see_py.clear(); + see_pz.clear(); + see_pt.clear(); + see_eta.clear(); + see_phi.clear(); + see_dxy.clear(); + see_dz.clear(); + see_ptErr.clear(); + see_etaErr.clear(); + see_phiErr.clear(); + see_dxyErr.clear(); + see_dzErr.clear(); + see_chi2.clear(); see_statePt.clear(); see_stateTrajX.clear(); see_stateTrajY.clear(); see_stateTrajPx.clear(); see_stateTrajPy.clear(); see_stateTrajPz.clear(); - see_q .clear(); - see_nValid .clear(); - see_nPixel .clear(); - see_nGlued .clear(); - see_nStrip .clear(); + see_q.clear(); + see_nValid.clear(); + see_nPixel.clear(); + see_nGlued.clear(); + see_nStrip.clear(); see_nPhase2OT.clear(); see_nCluster.clear(); - see_algo .clear(); + see_algo.clear(); see_stopReason.clear(); - see_nCands .clear(); - see_trkIdx .clear(); + see_nCands.clear(); + see_trkIdx.clear(); see_bestSimTrkIdx.clear(); see_bestSimTrkShareFrac.clear(); see_bestFromFirstHitSimTrkIdx.clear(); see_bestFromFirstHitSimTrkShareFrac.clear(); see_simTrkIdx.clear(); see_simTrkShareFrac.clear(); - see_hitIdx .clear(); - see_hitType .clear(); + see_hitIdx.clear(); + see_hitType.clear(); //seed algo offset see_offset.clear(); @@ -1981,10 +1977,8 @@ void TrackingNtuple::clearVariables() { simpv_idx.clear(); } - // ------------ method called for each event ------------ void TrackingNtuple::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { - using namespace edm; using namespace reco; using namespace std; @@ -1994,7 +1988,7 @@ void TrackingNtuple::analyze(const edm::Event& iEvent, const edm::EventSetup& iS const auto& mf = *mfHandle; edm::ESHandle theTTRHBuilder; - iSetup.get().get(builderName_,theTTRHBuilder); + iSetup.get().get(builderName_, theTTRHBuilder); edm::ESHandle tTopoHandle; iSetup.get().get(tTopoHandle); @@ -2002,7 +1996,7 @@ void TrackingNtuple::analyze(const edm::Event& iEvent, const edm::EventSetup& iS edm::ESHandle geometryHandle; iSetup.get().get(geometryHandle); - const TrackerGeometry &tracker = *geometryHandle; + const TrackerGeometry& tracker = *geometryHandle; edm::Handle theAssociator; iEvent.getByToken(trackAssociatorToken_, theAssociator); @@ -2017,18 +2011,17 @@ void TrackingNtuple::analyze(const edm::Event& iEvent, const edm::EventSetup& iS // TrackingParticles... Unfortunately it has non-trivial // consequences on the associator/association interfaces etc. TrackingParticleRefVector tmpTP; - const TrackingParticleRefVector *tmpTPptr = nullptr; - edm::Handle TPCollectionH; - edm::Handle TPCollectionHRefVector; + const TrackingParticleRefVector* tmpTPptr = nullptr; + edm::Handle TPCollectionH; + edm::Handle TPCollectionHRefVector; - if(!trackingParticleToken_.isUninitialized()) { + if (!trackingParticleToken_.isUninitialized()) { iEvent.getByToken(trackingParticleToken_, TPCollectionH); - for(size_t i=0, size=TPCollectionH->size(); isize(); i < size; ++i) { tmpTP.push_back(TrackingParticleRef(TPCollectionH, i)); } tmpTPptr = &tmpTP; - } - else { + } else { iEvent.getByToken(trackingParticleRefToken_, TPCollectionHRefVector); tmpTPptr = TPCollectionHRefVector.product(); } @@ -2036,7 +2029,7 @@ void TrackingNtuple::analyze(const edm::Event& iEvent, const edm::EventSetup& iS // Fill mapping from Ref::key() to index TrackingParticleRefKeyToIndex tpKeyToIndex; - for(size_t i=0; i cluster count TrackingParticleRefKeyToCount tpKeyToClusterCount; - for(const auto& clusterTP: clusterToTPMap) { + for (const auto& clusterTP : clusterToTPMap) { tpKeyToClusterCount[clusterTP.second.key()] += 1; } @@ -2085,83 +2078,123 @@ void TrackingNtuple::analyze(const edm::Event& iEvent, const edm::EventSetup& iS ev_event = iEvent.id().event(); // Digi->Sim links for pixels and strips - edm::Handle > pixelDigiSimLinksHandle; + edm::Handle> pixelDigiSimLinksHandle; iEvent.getByToken(pixelSimLinkToken_, pixelDigiSimLinksHandle); const auto& pixelDigiSimLinks = *pixelDigiSimLinksHandle; - edm::Handle > stripDigiSimLinksHandle; + edm::Handle> stripDigiSimLinksHandle; iEvent.getByToken(stripSimLinkToken_, stripDigiSimLinksHandle); // Phase2 OT DigiSimLink - edm::Handle > siphase2OTSimLinksHandle; + edm::Handle> siphase2OTSimLinksHandle; iEvent.getByToken(siphase2OTSimLinksToken_, siphase2OTSimLinksHandle); //beamspot Handle recoBeamSpotHandle; iEvent.getByToken(beamSpotToken_, recoBeamSpotHandle); - BeamSpot const & bs = *recoBeamSpotHandle; + BeamSpot const& bs = *recoBeamSpotHandle; fillBeamSpot(bs); - //prapare list to link matched hits to collection - vector > monoStereoClusterList; - if(includeAllHits_) { + vector> monoStereoClusterList; + if (includeAllHits_) { // simhits, only if TPs are saved as well - if(includeTrackingParticles_) { + if (includeTrackingParticles_) { fillSimHits(tracker, tpKeyToIndex, *simHitsTPAssoc, tTopo, simHitRefKeyToIndex, tpHitList); } //pixel hits - fillPixelHits(iEvent, clusterToTPMap, tpKeyToIndex, *simHitsTPAssoc, pixelDigiSimLinks, *theTTRHBuilder, tTopo, simHitRefKeyToIndex, hitProductIds); + fillPixelHits(iEvent, + clusterToTPMap, + tpKeyToIndex, + *simHitsTPAssoc, + pixelDigiSimLinks, + *theTTRHBuilder, + tTopo, + simHitRefKeyToIndex, + hitProductIds); //strip hits - if(includeStripHits_){ - LogDebug("TrackingNtuple") << "foundStripSimLink" ; + if (includeStripHits_) { + LogDebug("TrackingNtuple") << "foundStripSimLink"; const auto& stripDigiSimLinks = *stripDigiSimLinksHandle; - fillStripRphiStereoHits(iEvent, clusterToTPMap, tpKeyToIndex, *simHitsTPAssoc, stripDigiSimLinks, *theTTRHBuilder, tTopo, simHitRefKeyToIndex, hitProductIds); + fillStripRphiStereoHits(iEvent, + clusterToTPMap, + tpKeyToIndex, + *simHitsTPAssoc, + stripDigiSimLinks, + *theTTRHBuilder, + tTopo, + simHitRefKeyToIndex, + hitProductIds); //matched hits fillStripMatchedHits(iEvent, *theTTRHBuilder, tTopo, monoStereoClusterList); } - if(includePhase2OTHits_){ - LogDebug("TrackingNtuple") << "foundPhase2OTSimLinks" ; + if (includePhase2OTHits_) { + LogDebug("TrackingNtuple") << "foundPhase2OTSimLinks"; const auto& phase2OTSimLinks = *siphase2OTSimLinksHandle; - fillPhase2OTHits(iEvent, clusterToTPMap, tpKeyToIndex, *simHitsTPAssoc, phase2OTSimLinks, *theTTRHBuilder, tTopo, simHitRefKeyToIndex, hitProductIds); + fillPhase2OTHits(iEvent, + clusterToTPMap, + tpKeyToIndex, + *simHitsTPAssoc, + phase2OTSimLinks, + *theTTRHBuilder, + tTopo, + simHitRefKeyToIndex, + hitProductIds); } } //seeds - if(includeSeeds_) { - fillSeeds(iEvent, tpCollection, tpKeyToIndex, bs, associatorByHits, clusterToTPMap, *theTTRHBuilder, mf, tTopo, monoStereoClusterList, hitProductIds, seedCollToOffset); + if (includeSeeds_) { + fillSeeds(iEvent, + tpCollection, + tpKeyToIndex, + bs, + associatorByHits, + clusterToTPMap, + *theTTRHBuilder, + mf, + tTopo, + monoStereoClusterList, + hitProductIds, + seedCollToOffset); } //tracks - edm::Handle > tracksHandle; + edm::Handle> tracksHandle; iEvent.getByToken(trackToken_, tracksHandle); const edm::View& tracks = *tracksHandle; // The associator interfaces really need to be fixed... edm::RefToBaseVector trackRefs; - for(edm::View::size_type i=0; i::size_type i = 0; i < tracks.size(); ++i) { trackRefs.push_back(tracks.refAt(i)); } - std::vector mvaColls; - std::vector qualColls; - if(includeMVA_) { + std::vector mvaColls; + std::vector qualColls; + if (includeMVA_) { edm::Handle hmva; edm::Handle hqual; - for(const auto& tokenTpl: mvaQualityCollectionTokens_) { + for (const auto& tokenTpl : mvaQualityCollectionTokens_) { iEvent.getByToken(std::get<0>(tokenTpl), hmva); iEvent.getByToken(std::get<1>(tokenTpl), hqual); mvaColls.push_back(hmva.product()); qualColls.push_back(hqual.product()); - if(mvaColls.back()->size() != tracks.size()) { - throw cms::Exception("Configuration") << "Inconsistency in track collection and MVA sizes. Track collection has " << tracks.size() << " tracks, whereas the MVA " << (mvaColls.size()-1) << " has " << mvaColls.back()->size() << " entries. Double-check your configuration."; + if (mvaColls.back()->size() != tracks.size()) { + throw cms::Exception("Configuration") + << "Inconsistency in track collection and MVA sizes. Track collection has " << tracks.size() + << " tracks, whereas the MVA " << (mvaColls.size() - 1) << " has " << mvaColls.back()->size() + << " entries. Double-check your configuration."; } - if(qualColls.back()->size() != tracks.size()) { - throw cms::Exception("Configuration") << "Inconsistency in track collection and quality mask sizes. Track collection has " << tracks.size() << " tracks, whereas the quality mask " << (qualColls.size()-1) << " has " << qualColls.back()->size() << " entries. Double-check your configuration."; + if (qualColls.back()->size() != tracks.size()) { + throw cms::Exception("Configuration") + << "Inconsistency in track collection and quality mask sizes. Track collection has " << tracks.size() + << " tracks, whereas the quality mask " << (qualColls.size() - 1) << " has " << qualColls.back()->size() + << " entries. Double-check your configuration."; } } } @@ -2169,12 +2202,27 @@ void TrackingNtuple::analyze(const edm::Event& iEvent, const edm::EventSetup& iS edm::Handle vertices; iEvent.getByToken(vertexToken_, vertices); - fillTracks(trackRefs, tpCollection, tpKeyToIndex, tpKeyToClusterCount, mf, bs, *vertices, associatorByHits, clusterToTPMap, *theTTRHBuilder, tTopo, hitProductIds, seedCollToOffset, mvaColls, qualColls); + fillTracks(trackRefs, + tpCollection, + tpKeyToIndex, + tpKeyToClusterCount, + mf, + bs, + *vertices, + associatorByHits, + clusterToTPMap, + *theTTRHBuilder, + tTopo, + hitProductIds, + seedCollToOffset, + mvaColls, + qualColls); //tracking particles //sort association maps with simHits - std::sort( tpHitList.begin(), tpHitList.end(), tpHitIndexListLessSort ); - fillTrackingParticles(iEvent, iSetup, trackRefs, bs, tpCollection, tvKeyToIndex, associatorByHits, tpHitList, tpKeyToClusterCount); + std::sort(tpHitList.begin(), tpHitList.end(), tpHitIndexListLessSort); + fillTrackingParticles( + iEvent, iSetup, trackRefs, bs, tpCollection, tvKeyToIndex, associatorByHits, tpHitList, tpKeyToClusterCount); // vertices fillVertices(*vertices, trackRefs); @@ -2183,7 +2231,6 @@ void TrackingNtuple::analyze(const edm::Event& iEvent, const edm::EventSetup& iS fillTrackingVertices(tvRefs, tpKeyToIndex); t->Fill(); - } void TrackingNtuple::fillBeamSpot(const reco::BeamSpot& bs) { @@ -2196,7 +2243,8 @@ void TrackingNtuple::fillBeamSpot(const reco::BeamSpot& bs) { } namespace { - template struct GetCluster; + template + struct GetCluster; template <> struct GetCluster { static const SiPixelCluster& call(const OmniClusterRef& cluster) { return cluster.pixelCluster(); } @@ -2205,58 +2253,63 @@ namespace { struct GetCluster { static const SiStripCluster& call(const OmniClusterRef& cluster) { return cluster.stripCluster(); } }; -} +} // namespace template -TrackingNtuple::SimHitData TrackingNtuple::matchCluster(const OmniClusterRef& cluster, - DetId hitId, int clusterKey, - const TransientTrackingRecHit::RecHitPointer& ttrh, - const ClusterTPAssociation& clusterToTPMap, - const TrackingParticleRefKeyToIndex& tpKeyToIndex, - const SimHitTPAssociationProducer::SimHitTPAssociationList& simHitsTPAssoc, - const edm::DetSetVector& digiSimLinks, - const SimHitRefKeyToIndex& simHitRefKeyToIndex, - HitType hitType - ) { +TrackingNtuple::SimHitData TrackingNtuple::matchCluster( + const OmniClusterRef& cluster, + DetId hitId, + int clusterKey, + const TransientTrackingRecHit::RecHitPointer& ttrh, + const ClusterTPAssociation& clusterToTPMap, + const TrackingParticleRefKeyToIndex& tpKeyToIndex, + const SimHitTPAssociationProducer::SimHitTPAssociationList& simHitsTPAssoc, + const edm::DetSetVector& digiSimLinks, + const SimHitRefKeyToIndex& simHitRefKeyToIndex, + HitType hitType) { SimHitData ret; std::map simTrackIdToChargeFraction; - if(hitType == HitType::Phase2OT) simTrackIdToChargeFraction = chargeFraction(cluster.phase2OTCluster(), hitId, digiSimLinks); - else simTrackIdToChargeFraction = chargeFraction(GetCluster::call(cluster), hitId, digiSimLinks); + if (hitType == HitType::Phase2OT) + simTrackIdToChargeFraction = chargeFraction(cluster.phase2OTCluster(), hitId, digiSimLinks); + else + simTrackIdToChargeFraction = chargeFraction(GetCluster::call(cluster), hitId, digiSimLinks); ret.type = HitSimType::Noise; - auto range = clusterToTPMap.equal_range( cluster ); - if( range.first != range.second ) { - for( auto ip=range.first; ip != range.second; ++ip ) { + auto range = clusterToTPMap.equal_range(cluster); + if (range.first != range.second) { + for (auto ip = range.first; ip != range.second; ++ip) { const TrackingParticleRef& trackingParticle = ip->second; // Find out if the cluster is from signal/ITPU/OOTPU const auto event = trackingParticle->eventId().event(); const auto bx = trackingParticle->eventId().bunchCrossing(); HitSimType type = HitSimType::OOTPileup; - if(bx == 0) { + if (bx == 0) { type = (event == 0 ? HitSimType::Signal : HitSimType::ITPileup); } ret.type = static_cast(std::min(static_cast(ret.type), static_cast(type))); // Limit to only input TrackingParticles (usually signal+ITPU) auto tpIndex = tpKeyToIndex.find(trackingParticle.key()); - if( tpIndex == tpKeyToIndex.end()) + if (tpIndex == tpKeyToIndex.end()) continue; //now get the corresponding sim hit - std::pair simHitTPpairWithDummyTP(trackingParticle,TrackPSimHitRef()); + std::pair simHitTPpairWithDummyTP(trackingParticle, TrackPSimHitRef()); //SimHit is dummy: for simHitTPAssociationListGreater sorting only the TP is needed - auto range = std::equal_range(simHitsTPAssoc.begin(), simHitsTPAssoc.end(), - simHitTPpairWithDummyTP, SimHitTPAssociationProducer::simHitTPAssociationListGreater); + auto range = std::equal_range(simHitsTPAssoc.begin(), + simHitsTPAssoc.end(), + simHitTPpairWithDummyTP, + SimHitTPAssociationProducer::simHitTPAssociationListGreater); bool foundSimHit = false; bool foundElectron = false; - for(auto ip = range.first; ip != range.second; ++ip) { + for (auto ip = range.first; ip != range.second; ++ip) { TrackPSimHitRef TPhit = ip->second; DetId dId = DetId(TPhit->detUnitId()); - if (dId.rawId()==hitId.rawId()) { + if (dId.rawId() == hitId.rawId()) { // skip electron SimHits for non-electron TPs also here - if(std::abs(TPhit->particleType()) == 11 && std::abs(trackingParticle->pdgId()) != 11) { + if (std::abs(TPhit->particleType()) == 11 && std::abs(trackingParticle->pdgId()) != 11) { foundElectron = true; continue; } @@ -2269,9 +2322,9 @@ TrackingNtuple::SimHitData TrackingNtuple::matchCluster(const OmniClusterRef& cl ret.matchingSimHit.push_back(simHitIndex); double chargeFraction = 0.; - for(const SimTrack& simtrk: trackingParticle->g4Tracks()) { + for (const SimTrack& simtrk : trackingParticle->g4Tracks()) { auto found = simTrackIdToChargeFraction.find(simtrk.trackId()); - if(found != simTrackIdToChargeFraction.end()) { + if (found != simTrackIdToChargeFraction.end()) { chargeFraction += found->second; } } @@ -2285,22 +2338,23 @@ TrackingNtuple::SimHitData TrackingNtuple::matchCluster(const OmniClusterRef& cl simhit_hitType[simHitIndex].push_back(static_cast(hitType)); } } - if(!foundSimHit) { + if (!foundSimHit) { // In case we didn't find a simhit because of filtered-out // electron SimHit, just ignore the missing SimHit. - if(foundElectron) + if (foundElectron) continue; - auto ex = cms::Exception("LogicError") << "Did not find SimHit for reco hit DetId " << hitId.rawId() - << " for TP " << trackingParticle.key() << " bx:event " << bx << ":" << event - << ".\nFound SimHits from detectors "; - for(auto ip = range.first; ip != range.second; ++ip) { + auto ex = cms::Exception("LogicError") + << "Did not find SimHit for reco hit DetId " << hitId.rawId() << " for TP " << trackingParticle.key() + << " bx:event " << bx << ":" << event << ".\nFound SimHits from detectors "; + for (auto ip = range.first; ip != range.second; ++ip) { TrackPSimHitRef TPhit = ip->second; DetId dId = DetId(TPhit->detUnitId()); ex << dId.rawId() << " "; } - if(trackingParticle->eventId().event() != 0) { - ex << "\nSince this is a TrackingParticle from pileup, check that you're running the pileup mixing in playback mode."; + if (trackingParticle->eventId().event() != 0) { + ex << "\nSince this is a TrackingParticle from pileup, check that you're running the pileup mixing in " + "playback mode."; } throw ex; } @@ -2316,68 +2370,83 @@ void TrackingNtuple::fillSimHits(const TrackerGeometry& tracker, const TrackerTopology& tTopo, SimHitRefKeyToIndex& simHitRefKeyToIndex, std::vector& tpHitList) { - - for(const auto& assoc: simHitsTPAssoc) { + for (const auto& assoc : simHitsTPAssoc) { auto tpKey = assoc.first.key(); // SimHitTPAssociationList can contain more TrackingParticles than // what are given to this EDAnalyzer, so we can filter those out here. auto found = tpKeyToIndex.find(tpKey); - if(found == tpKeyToIndex.end()) + if (found == tpKeyToIndex.end()) continue; const auto tpIndex = found->second; // skip non-tracker simhits (mostly muons) const auto& simhit = *(assoc.second); auto detId = DetId(simhit.detUnitId()); - if(detId.det() != DetId::Tracker) continue; + if (detId.det() != DetId::Tracker) + continue; // Skip electron SimHits for non-electron TrackingParticles to // filter out delta rays. The delta ray hits just confuse. If we // need them later, let's add them as a separate "collection" of // hits of a TP const TrackingParticle& tp = *(assoc.first); - if(std::abs(simhit.particleType()) == 11 && std::abs(tp.pdgId()) != 11) continue; + if (std::abs(simhit.particleType()) == 11 && std::abs(tp.pdgId()) != 11) + continue; auto simHitKey = std::make_pair(assoc.second.key(), assoc.second.id()); - if(simHitRefKeyToIndex.find(simHitKey) != simHitRefKeyToIndex.end()) { - for(const auto& assoc2: simHitsTPAssoc) { - if(std::make_pair(assoc2.second.key(), assoc2.second.id()) == simHitKey) { - + if (simHitRefKeyToIndex.find(simHitKey) != simHitRefKeyToIndex.end()) { + for (const auto& assoc2 : simHitsTPAssoc) { + if (std::make_pair(assoc2.second.key(), assoc2.second.id()) == simHitKey) { #ifdef EDM_ML_DEBUG - auto range1 = std::equal_range(simHitsTPAssoc.begin(), simHitsTPAssoc.end(), + auto range1 = std::equal_range(simHitsTPAssoc.begin(), + simHitsTPAssoc.end(), std::make_pair(assoc.first, TrackPSimHitRef()), SimHitTPAssociationProducer::simHitTPAssociationListGreater); - auto range2 = std::equal_range(simHitsTPAssoc.begin(), simHitsTPAssoc.end(), + auto range2 = std::equal_range(simHitsTPAssoc.begin(), + simHitsTPAssoc.end(), std::make_pair(assoc2.first, TrackPSimHitRef()), SimHitTPAssociationProducer::simHitTPAssociationListGreater); LogTrace("TrackingNtuple") << "Earlier TP " << assoc2.first.key() << " SimTrack Ids"; - for(const auto& simTrack: assoc2.first->g4Tracks()) { - edm::LogPrint("TrackingNtuple") << " SimTrack " << simTrack.trackId() << " BX:event " << simTrack.eventId().bunchCrossing() << ":" << simTrack.eventId().event(); + for (const auto& simTrack : assoc2.first->g4Tracks()) { + edm::LogPrint("TrackingNtuple") << " SimTrack " << simTrack.trackId() << " BX:event " + << simTrack.eventId().bunchCrossing() << ":" << simTrack.eventId().event(); } - for(auto iHit = range2.first; iHit != range2.second; ++iHit) { - LogTrace("TrackingNtuple") << " SimHit " << iHit->second.key() << " " << iHit->second.id() << " tof " << iHit->second->tof() << " trackId " << iHit->second->trackId() << " BX:event " << iHit->second->eventId().bunchCrossing() << ":" << iHit->second->eventId().event(); + for (auto iHit = range2.first; iHit != range2.second; ++iHit) { + LogTrace("TrackingNtuple") << " SimHit " << iHit->second.key() << " " << iHit->second.id() << " tof " + << iHit->second->tof() << " trackId " << iHit->second->trackId() << " BX:event " + << iHit->second->eventId().bunchCrossing() << ":" + << iHit->second->eventId().event(); } LogTrace("TrackingNtuple") << "Current TP " << assoc.first.key() << " SimTrack Ids"; - for(const auto& simTrack: assoc.first->g4Tracks()) { - edm::LogPrint("TrackingNtuple") << " SimTrack " << simTrack.trackId() << " BX:event " << simTrack.eventId().bunchCrossing() << ":" << simTrack.eventId().event(); + for (const auto& simTrack : assoc.first->g4Tracks()) { + edm::LogPrint("TrackingNtuple") << " SimTrack " << simTrack.trackId() << " BX:event " + << simTrack.eventId().bunchCrossing() << ":" << simTrack.eventId().event(); } - for(auto iHit = range1.first; iHit != range1.second; ++iHit) { - LogTrace("TrackingNtuple") << " SimHit " << iHit->second.key() << " " << iHit->second.id() << " tof " << iHit->second->tof() << " trackId " << iHit->second->trackId() << " BX:event " << iHit->second->eventId().bunchCrossing() << ":" << iHit->second->eventId().event(); + for (auto iHit = range1.first; iHit != range1.second; ++iHit) { + LogTrace("TrackingNtuple") << " SimHit " << iHit->second.key() << " " << iHit->second.id() << " tof " + << iHit->second->tof() << " trackId " << iHit->second->trackId() << " BX:event " + << iHit->second->eventId().bunchCrossing() << ":" + << iHit->second->eventId().event(); } #endif - throw cms::Exception("LogicError") << "Got second time the SimHit " << simHitKey.first << " of " << simHitKey.second << ", first time with TrackingParticle " << assoc2.first.key() << ", now with " << tpKey; + throw cms::Exception("LogicError") + << "Got second time the SimHit " << simHitKey.first << " of " << simHitKey.second + << ", first time with TrackingParticle " << assoc2.first.key() << ", now with " << tpKey; } } - throw cms::Exception("LogicError") << "Got second time the SimHit " << simHitKey.first << " of " << simHitKey.second << ", now with TrackingParticle " << tpKey << ", but I didn't find the first occurrance!"; + throw cms::Exception("LogicError") << "Got second time the SimHit " << simHitKey.first << " of " + << simHitKey.second << ", now with TrackingParticle " << tpKey + << ", but I didn't find the first occurrance!"; } auto det = tracker.idToDetUnit(detId); - if(!det) - throw cms::Exception("LogicError") << "Did not find a det unit for DetId " << simhit.detUnitId() << " from tracker geometry"; + if (!det) + throw cms::Exception("LogicError") << "Did not find a det unit for DetId " << simhit.detUnitId() + << " from tracker geometry"; const auto pos = det->surface().toGlobal(simhit.localPosition()); const float tof = simhit.timeOfFlight(); @@ -2385,8 +2454,10 @@ void TrackingNtuple::fillSimHits(const TrackerGeometry& tracker, const auto simHitIndex = simhit_x.size(); simHitRefKeyToIndex[simHitKey] = simHitIndex; - if(includeStripHits_) simhit_detId.push_back(tTopo, detId); - else simhit_detId_phase2.push_back(tTopo, detId); + if (includeStripHits_) + simhit_detId.push_back(tTopo, detId); + else + simhit_detId_phase2.push_back(tTopo, detId); simhit_x.push_back(pos.x()); simhit_y.push_back(pos.y()); simhit_z.push_back(pos.z()); @@ -2398,8 +2469,8 @@ void TrackingNtuple::fillSimHits(const TrackerGeometry& tracker, simhit_simTrkIdx.push_back(tpIndex); - simhit_hitIdx.emplace_back(); // filled in matchCluster - simhit_hitType.emplace_back(); // filled in matchCluster + simhit_hitIdx.emplace_back(); // filled in matchCluster + simhit_hitType.emplace_back(); // filled in matchCluster tpHitList.emplace_back(tpKey, simHitIndex, tof, simhit.detUnitId()); } @@ -2413,13 +2484,12 @@ void TrackingNtuple::fillPixelHits(const edm::Event& iEvent, const TransientTrackingRecHitBuilder& theTTRHBuilder, const TrackerTopology& tTopo, const SimHitRefKeyToIndex& simHitRefKeyToIndex, - std::set& hitProductIds - ) { + std::set& hitProductIds) { edm::Handle pixelHits; iEvent.getByToken(pixelRecHitToken_, pixelHits); - for (auto it = pixelHits->begin(); it!=pixelHits->end(); it++ ) { + for (auto it = pixelHits->begin(); it != pixelHits->end(); it++) { const DetId hitId = it->detId(); - for (auto hit = it->begin(); hit!=it->end(); hit++ ) { + for (auto hit = it->begin(); hit != it->end(); hit++) { TransientTrackingRecHit::RecHitPointer ttrh = theTTRHBuilder.build(&*hit); hitProductIds.insert(hit->cluster().id()); @@ -2427,38 +2497,43 @@ void TrackingNtuple::fillPixelHits(const edm::Event& iEvent, const int key = hit->cluster().key(); const int lay = tTopo.layer(hitId); - pix_isBarrel .push_back( hitId.subdetId()==1 ); - pix_detId .push_back( tTopo, hitId ); - pix_trkIdx .emplace_back(); // filled in fillTracks - pix_seeIdx .emplace_back(); // filled in fillSeeds - pix_x .push_back( ttrh->globalPosition().x() ); - pix_y .push_back( ttrh->globalPosition().y() ); - pix_z .push_back( ttrh->globalPosition().z() ); - pix_xx .push_back( ttrh->globalPositionError().cxx() ); - pix_xy .push_back( ttrh->globalPositionError().cyx() ); - pix_yy .push_back( ttrh->globalPositionError().cyy() ); - pix_yz .push_back( ttrh->globalPositionError().czy() ); - pix_zz .push_back( ttrh->globalPositionError().czz() ); - pix_zx .push_back( ttrh->globalPositionError().czx() ); - pix_radL .push_back( ttrh->surface()->mediumProperties().radLen() ); - pix_bbxi .push_back( ttrh->surface()->mediumProperties().xi() ); - - LogTrace("TrackingNtuple") << "pixHit cluster=" << key - << " subdId=" << hitId.subdetId() - << " lay=" << lay - << " rawId=" << hitId.rawId() - << " pos =" << ttrh->globalPosition(); - if(includeTrackingParticles_) { - SimHitData simHitData = matchCluster(hit->firstClusterRef(), hitId, key, ttrh, - clusterToTPMap, tpKeyToIndex, simHitsTPAssoc, digiSimLink, simHitRefKeyToIndex, HitType::Pixel); - pix_simHitIdx.push_back( simHitData.matchingSimHit ); - pix_simType.push_back( static_cast(simHitData.type) ); - pix_chargeFraction.push_back( simHitData.chargeFraction ); + pix_isBarrel.push_back(hitId.subdetId() == 1); + pix_detId.push_back(tTopo, hitId); + pix_trkIdx.emplace_back(); // filled in fillTracks + pix_seeIdx.emplace_back(); // filled in fillSeeds + pix_x.push_back(ttrh->globalPosition().x()); + pix_y.push_back(ttrh->globalPosition().y()); + pix_z.push_back(ttrh->globalPosition().z()); + pix_xx.push_back(ttrh->globalPositionError().cxx()); + pix_xy.push_back(ttrh->globalPositionError().cyx()); + pix_yy.push_back(ttrh->globalPositionError().cyy()); + pix_yz.push_back(ttrh->globalPositionError().czy()); + pix_zz.push_back(ttrh->globalPositionError().czz()); + pix_zx.push_back(ttrh->globalPositionError().czx()); + pix_radL.push_back(ttrh->surface()->mediumProperties().radLen()); + pix_bbxi.push_back(ttrh->surface()->mediumProperties().xi()); + + LogTrace("TrackingNtuple") << "pixHit cluster=" << key << " subdId=" << hitId.subdetId() << " lay=" << lay + << " rawId=" << hitId.rawId() << " pos =" << ttrh->globalPosition(); + if (includeTrackingParticles_) { + SimHitData simHitData = matchCluster(hit->firstClusterRef(), + hitId, + key, + ttrh, + clusterToTPMap, + tpKeyToIndex, + simHitsTPAssoc, + digiSimLink, + simHitRefKeyToIndex, + HitType::Pixel); + pix_simHitIdx.push_back(simHitData.matchingSimHit); + pix_simType.push_back(static_cast(simHitData.type)); + pix_chargeFraction.push_back(simHitData.chargeFraction); LogTrace("TrackingNtuple") << " nMatchingSimHit=" << simHitData.matchingSimHit.size(); - if(!simHitData.matchingSimHit.empty()) { + if (!simHitData.matchingSimHit.empty()) { const auto simHitIdx = simHitData.matchingSimHit[0]; - LogTrace("TrackingNtuple") << " firstMatchingSimHit=" << simHitIdx - << " simHitPos=" << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx]) + LogTrace("TrackingNtuple") << " firstMatchingSimHit=" << simHitIdx << " simHitPos=" + << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx]) << " energyLoss=" << simhit_eloss[simHitIdx] << " particleType=" << simhit_particle[simHitIdx] << " processType=" << simhit_process[simHitIdx] @@ -2470,7 +2545,6 @@ void TrackingNtuple::fillPixelHits(const edm::Event& iEvent, } } - void TrackingNtuple::fillStripRphiStereoHits(const edm::Event& iEvent, const ClusterTPAssociation& clusterToTPMap, const TrackingParticleRefKeyToIndex& tpKeyToIndex, @@ -2479,74 +2553,79 @@ void TrackingNtuple::fillStripRphiStereoHits(const edm::Event& iEvent, const TransientTrackingRecHitBuilder& theTTRHBuilder, const TrackerTopology& tTopo, const SimHitRefKeyToIndex& simHitRefKeyToIndex, - std::set& hitProductIds - ) { + std::set& hitProductIds) { //index strip hit branches by cluster index edm::Handle rphiHits; iEvent.getByToken(stripRphiRecHitToken_, rphiHits); edm::Handle stereoHits; iEvent.getByToken(stripStereoRecHitToken_, stereoHits); - int totalStripHits = rphiHits->dataSize()+stereoHits->dataSize(); - str_isBarrel .resize(totalStripHits); - str_detId .resize(totalStripHits); - str_trkIdx .resize(totalStripHits); // filled in fillTracks - str_seeIdx .resize(totalStripHits); // filled in fillSeeds + int totalStripHits = rphiHits->dataSize() + stereoHits->dataSize(); + str_isBarrel.resize(totalStripHits); + str_detId.resize(totalStripHits); + str_trkIdx.resize(totalStripHits); // filled in fillTracks + str_seeIdx.resize(totalStripHits); // filled in fillSeeds str_simHitIdx.resize(totalStripHits); - str_simType .resize(totalStripHits); + str_simType.resize(totalStripHits); str_chargeFraction.resize(totalStripHits); - str_x .resize(totalStripHits); - str_y .resize(totalStripHits); - str_z .resize(totalStripHits); - str_xx .resize(totalStripHits); - str_xy .resize(totalStripHits); - str_yy .resize(totalStripHits); - str_yz .resize(totalStripHits); - str_zz .resize(totalStripHits); - str_zx .resize(totalStripHits); - str_radL .resize(totalStripHits); - str_bbxi .resize(totalStripHits); - - auto fill = [&](const SiStripRecHit2DCollection& hits, const char *name) { - for(const auto& detset: hits) { + str_x.resize(totalStripHits); + str_y.resize(totalStripHits); + str_z.resize(totalStripHits); + str_xx.resize(totalStripHits); + str_xy.resize(totalStripHits); + str_yy.resize(totalStripHits); + str_yz.resize(totalStripHits); + str_zz.resize(totalStripHits); + str_zx.resize(totalStripHits); + str_radL.resize(totalStripHits); + str_bbxi.resize(totalStripHits); + + auto fill = [&](const SiStripRecHit2DCollection& hits, const char* name) { + for (const auto& detset : hits) { const DetId hitId = detset.detId(); - for(const auto& hit: detset) { + for (const auto& hit : detset) { TransientTrackingRecHit::RecHitPointer ttrh = theTTRHBuilder.build(&hit); hitProductIds.insert(hit.cluster().id()); const int key = hit.cluster().key(); const int lay = tTopo.layer(hitId); - str_isBarrel [key] = (hitId.subdetId()==StripSubdetector::TIB || hitId.subdetId()==StripSubdetector::TOB); + str_isBarrel[key] = (hitId.subdetId() == StripSubdetector::TIB || hitId.subdetId() == StripSubdetector::TOB); str_detId.set(key, tTopo, hitId); - str_x [key] = ttrh->globalPosition().x(); - str_y [key] = ttrh->globalPosition().y(); - str_z [key] = ttrh->globalPosition().z(); - str_xx [key] = ttrh->globalPositionError().cxx(); - str_xy [key] = ttrh->globalPositionError().cyx(); - str_yy [key] = ttrh->globalPositionError().cyy(); - str_yz [key] = ttrh->globalPositionError().czy(); - str_zz [key] = ttrh->globalPositionError().czz(); - str_zx [key] = ttrh->globalPositionError().czx(); - str_radL [key] = ttrh->surface()->mediumProperties().radLen(); - str_bbxi [key] = ttrh->surface()->mediumProperties().xi(); - LogTrace("TrackingNtuple") << name << " cluster=" << key - << " subdId=" << hitId.subdetId() - << " lay=" << lay - << " rawId=" << hitId.rawId() - << " pos =" << ttrh->globalPosition(); - - if(includeTrackingParticles_) { - SimHitData simHitData = matchCluster(hit.firstClusterRef(), hitId, key, ttrh, - clusterToTPMap, tpKeyToIndex, simHitsTPAssoc, digiSimLink, simHitRefKeyToIndex, HitType::Strip); + str_x[key] = ttrh->globalPosition().x(); + str_y[key] = ttrh->globalPosition().y(); + str_z[key] = ttrh->globalPosition().z(); + str_xx[key] = ttrh->globalPositionError().cxx(); + str_xy[key] = ttrh->globalPositionError().cyx(); + str_yy[key] = ttrh->globalPositionError().cyy(); + str_yz[key] = ttrh->globalPositionError().czy(); + str_zz[key] = ttrh->globalPositionError().czz(); + str_zx[key] = ttrh->globalPositionError().czx(); + str_radL[key] = ttrh->surface()->mediumProperties().radLen(); + str_bbxi[key] = ttrh->surface()->mediumProperties().xi(); + LogTrace("TrackingNtuple") << name << " cluster=" << key << " subdId=" << hitId.subdetId() << " lay=" << lay + << " rawId=" << hitId.rawId() << " pos =" << ttrh->globalPosition(); + + if (includeTrackingParticles_) { + SimHitData simHitData = matchCluster(hit.firstClusterRef(), + hitId, + key, + ttrh, + clusterToTPMap, + tpKeyToIndex, + simHitsTPAssoc, + digiSimLink, + simHitRefKeyToIndex, + HitType::Strip); str_simHitIdx[key] = simHitData.matchingSimHit; - str_simType [key] = static_cast(simHitData.type); + str_simType[key] = static_cast(simHitData.type); str_chargeFraction[key] = simHitData.chargeFraction; LogTrace("TrackingNtuple") << " nMatchingSimHit=" << simHitData.matchingSimHit.size(); - if(!simHitData.matchingSimHit.empty()) { + if (!simHitData.matchingSimHit.empty()) { const auto simHitIdx = simHitData.matchingSimHit[0]; - LogTrace("TrackingNtuple") << " firstMatchingSimHit=" << simHitIdx - << " simHitPos=" << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx]) - << " simHitPos=" << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx]) + LogTrace("TrackingNtuple") << " firstMatchingSimHit=" << simHitIdx << " simHitPos=" + << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx]) + << " simHitPos=" + << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx]) << " energyLoss=" << simhit_eloss[simHitIdx] << " particleType=" << simhit_particle[simHitIdx] << " processType=" << simhit_process[simHitIdx] @@ -2562,71 +2641,64 @@ void TrackingNtuple::fillStripRphiStereoHits(const edm::Event& iEvent, fill(*stereoHits, "stripStereoHit"); } - size_t TrackingNtuple::addStripMatchedHit(const SiStripMatchedRecHit2D& hit, const TransientTrackingRecHitBuilder& theTTRHBuilder, const TrackerTopology& tTopo, - std::vector >& monoStereoClusterList - ) { + std::vector>& monoStereoClusterList) { TransientTrackingRecHit::RecHitPointer ttrh = theTTRHBuilder.build(&hit); const auto hitId = hit.geographicalId(); const int lay = tTopo.layer(hitId); - monoStereoClusterList.emplace_back(hit.monoHit().cluster().key(),hit.stereoHit().cluster().key()); - glu_isBarrel .push_back( (hitId.subdetId()==StripSubdetector::TIB || hitId.subdetId()==StripSubdetector::TOB) ); - glu_detId .push_back( tTopo, hitId ); - glu_monoIdx .push_back( hit.monoHit().cluster().key() ); - glu_stereoIdx.push_back( hit.stereoHit().cluster().key() ); - glu_seeIdx .emplace_back(); // filled in fillSeeds - glu_x .push_back( ttrh->globalPosition().x() ); - glu_y .push_back( ttrh->globalPosition().y() ); - glu_z .push_back( ttrh->globalPosition().z() ); - glu_xx .push_back( ttrh->globalPositionError().cxx() ); - glu_xy .push_back( ttrh->globalPositionError().cyx() ); - glu_yy .push_back( ttrh->globalPositionError().cyy() ); - glu_yz .push_back( ttrh->globalPositionError().czy() ); - glu_zz .push_back( ttrh->globalPositionError().czz() ); - glu_zx .push_back( ttrh->globalPositionError().czx() ); - glu_radL .push_back( ttrh->surface()->mediumProperties().radLen() ); - glu_bbxi .push_back( ttrh->surface()->mediumProperties().xi() ); + monoStereoClusterList.emplace_back(hit.monoHit().cluster().key(), hit.stereoHit().cluster().key()); + glu_isBarrel.push_back((hitId.subdetId() == StripSubdetector::TIB || hitId.subdetId() == StripSubdetector::TOB)); + glu_detId.push_back(tTopo, hitId); + glu_monoIdx.push_back(hit.monoHit().cluster().key()); + glu_stereoIdx.push_back(hit.stereoHit().cluster().key()); + glu_seeIdx.emplace_back(); // filled in fillSeeds + glu_x.push_back(ttrh->globalPosition().x()); + glu_y.push_back(ttrh->globalPosition().y()); + glu_z.push_back(ttrh->globalPosition().z()); + glu_xx.push_back(ttrh->globalPositionError().cxx()); + glu_xy.push_back(ttrh->globalPositionError().cyx()); + glu_yy.push_back(ttrh->globalPositionError().cyy()); + glu_yz.push_back(ttrh->globalPositionError().czy()); + glu_zz.push_back(ttrh->globalPositionError().czz()); + glu_zx.push_back(ttrh->globalPositionError().czx()); + glu_radL.push_back(ttrh->surface()->mediumProperties().radLen()); + glu_bbxi.push_back(ttrh->surface()->mediumProperties().xi()); LogTrace("TrackingNtuple") << "stripMatchedHit" << " cluster0=" << hit.stereoHit().cluster().key() - << " cluster1=" << hit.monoHit().cluster().key() - << " subdId=" << hitId.subdetId() - << " lay=" << lay - << " rawId=" << hitId.rawId() - << " pos =" << ttrh->globalPosition(); - return glu_isBarrel.size()-1; + << " cluster1=" << hit.monoHit().cluster().key() << " subdId=" << hitId.subdetId() + << " lay=" << lay << " rawId=" << hitId.rawId() << " pos =" << ttrh->globalPosition(); + return glu_isBarrel.size() - 1; } void TrackingNtuple::fillStripMatchedHits(const edm::Event& iEvent, const TransientTrackingRecHitBuilder& theTTRHBuilder, const TrackerTopology& tTopo, - std::vector >& monoStereoClusterList - ) { + std::vector>& monoStereoClusterList) { edm::Handle matchedHits; iEvent.getByToken(stripMatchedRecHitToken_, matchedHits); - for (auto it = matchedHits->begin(); it!=matchedHits->end(); it++ ) { - for (auto hit = it->begin(); hit!=it->end(); hit++ ) { + for (auto it = matchedHits->begin(); it != matchedHits->end(); it++) { + for (auto hit = it->begin(); hit != it->end(); hit++) { addStripMatchedHit(*hit, theTTRHBuilder, tTopo, monoStereoClusterList); } } } void TrackingNtuple::fillPhase2OTHits(const edm::Event& iEvent, - const ClusterTPAssociation& clusterToTPMap, - const TrackingParticleRefKeyToIndex& tpKeyToIndex, - const SimHitTPAssociationProducer::SimHitTPAssociationList& simHitsTPAssoc, - const edm::DetSetVector& digiSimLink, - const TransientTrackingRecHitBuilder& theTTRHBuilder, - const TrackerTopology& tTopo, - const SimHitRefKeyToIndex& simHitRefKeyToIndex, - std::set& hitProductIds - ) { + const ClusterTPAssociation& clusterToTPMap, + const TrackingParticleRefKeyToIndex& tpKeyToIndex, + const SimHitTPAssociationProducer::SimHitTPAssociationList& simHitsTPAssoc, + const edm::DetSetVector& digiSimLink, + const TransientTrackingRecHitBuilder& theTTRHBuilder, + const TrackerTopology& tTopo, + const SimHitRefKeyToIndex& simHitRefKeyToIndex, + std::set& hitProductIds) { edm::Handle phase2OTHits; iEvent.getByToken(phase2OTRecHitToken_, phase2OTHits); - for (auto it = phase2OTHits->begin(); it!=phase2OTHits->end(); it++ ) { + for (auto it = phase2OTHits->begin(); it != phase2OTHits->end(); it++) { const DetId hitId = it->detId(); - for (auto hit = it->begin(); hit!=it->end(); hit++ ) { + for (auto hit = it->begin(); hit != it->end(); hit++) { TransientTrackingRecHit::RecHitPointer ttrh = theTTRHBuilder.build(&*hit); hitProductIds.insert(hit->cluster().id()); @@ -2634,38 +2706,43 @@ void TrackingNtuple::fillPhase2OTHits(const edm::Event& iEvent, const int key = hit->cluster().key(); const int lay = tTopo.layer(hitId); - ph2_isBarrel .push_back( hitId.subdetId()==1 ); - ph2_detId .push_back( tTopo, hitId ); - ph2_trkIdx .emplace_back(); // filled in fillTracks - ph2_seeIdx .emplace_back(); // filled in fillSeeds - ph2_x .push_back( ttrh->globalPosition().x() ); - ph2_y .push_back( ttrh->globalPosition().y() ); - ph2_z .push_back( ttrh->globalPosition().z() ); - ph2_xx .push_back( ttrh->globalPositionError().cxx() ); - ph2_xy .push_back( ttrh->globalPositionError().cyx() ); - ph2_yy .push_back( ttrh->globalPositionError().cyy() ); - ph2_yz .push_back( ttrh->globalPositionError().czy() ); - ph2_zz .push_back( ttrh->globalPositionError().czz() ); - ph2_zx .push_back( ttrh->globalPositionError().czx() ); - ph2_radL .push_back( ttrh->surface()->mediumProperties().radLen() ); - ph2_bbxi .push_back( ttrh->surface()->mediumProperties().xi() ); - - LogTrace("TrackingNtuple") << "phase2 OT cluster=" << key - << " subdId=" << hitId.subdetId() - << " lay=" << lay - << " rawId=" << hitId.rawId() - << " pos =" << ttrh->globalPosition(); - - if(includeTrackingParticles_) { - SimHitData simHitData = matchCluster(hit->firstClusterRef(), hitId, key, ttrh, - clusterToTPMap, tpKeyToIndex, simHitsTPAssoc, digiSimLink, simHitRefKeyToIndex, HitType::Phase2OT); - ph2_simHitIdx.push_back( simHitData.matchingSimHit ); - ph2_simType.push_back( static_cast(simHitData.type) ); + ph2_isBarrel.push_back(hitId.subdetId() == 1); + ph2_detId.push_back(tTopo, hitId); + ph2_trkIdx.emplace_back(); // filled in fillTracks + ph2_seeIdx.emplace_back(); // filled in fillSeeds + ph2_x.push_back(ttrh->globalPosition().x()); + ph2_y.push_back(ttrh->globalPosition().y()); + ph2_z.push_back(ttrh->globalPosition().z()); + ph2_xx.push_back(ttrh->globalPositionError().cxx()); + ph2_xy.push_back(ttrh->globalPositionError().cyx()); + ph2_yy.push_back(ttrh->globalPositionError().cyy()); + ph2_yz.push_back(ttrh->globalPositionError().czy()); + ph2_zz.push_back(ttrh->globalPositionError().czz()); + ph2_zx.push_back(ttrh->globalPositionError().czx()); + ph2_radL.push_back(ttrh->surface()->mediumProperties().radLen()); + ph2_bbxi.push_back(ttrh->surface()->mediumProperties().xi()); + + LogTrace("TrackingNtuple") << "phase2 OT cluster=" << key << " subdId=" << hitId.subdetId() << " lay=" << lay + << " rawId=" << hitId.rawId() << " pos =" << ttrh->globalPosition(); + + if (includeTrackingParticles_) { + SimHitData simHitData = matchCluster(hit->firstClusterRef(), + hitId, + key, + ttrh, + clusterToTPMap, + tpKeyToIndex, + simHitsTPAssoc, + digiSimLink, + simHitRefKeyToIndex, + HitType::Phase2OT); + ph2_simHitIdx.push_back(simHitData.matchingSimHit); + ph2_simType.push_back(static_cast(simHitData.type)); LogTrace("TrackingNtuple") << " nMatchingSimHit=" << simHitData.matchingSimHit.size(); - if(!simHitData.matchingSimHit.empty()) { + if (!simHitData.matchingSimHit.empty()) { const auto simHitIdx = simHitData.matchingSimHit[0]; - LogTrace("TrackingNtuple") << " firstMatchingSimHit=" << simHitIdx - << " simHitPos=" << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx]) + LogTrace("TrackingNtuple") << " firstMatchingSimHit=" << simHitIdx << " simHitPos=" + << GlobalPoint(simhit_x[simHitIdx], simhit_y[simHitIdx], simhit_z[simHitIdx]) << " energyLoss=" << simhit_eloss[simHitIdx] << " particleType=" << simhit_particle[simHitIdx] << " processType=" << simhit_process[simHitIdx] @@ -2677,7 +2754,6 @@ void TrackingNtuple::fillPhase2OTHits(const edm::Event& iEvent, } } - void TrackingNtuple::fillSeeds(const edm::Event& iEvent, const TrackingParticleRefVector& tpCollection, const TrackingParticleRefKeyToIndex& tpKeyToIndex, @@ -2687,38 +2763,39 @@ void TrackingNtuple::fillSeeds(const edm::Event& iEvent, const TransientTrackingRecHitBuilder& theTTRHBuilder, const MagneticField& theMF, const TrackerTopology& tTopo, - std::vector >& monoStereoClusterList, + std::vector>& monoStereoClusterList, const std::set& hitProductIds, - std::map& seedCollToOffset - ) { + std::map& seedCollToOffset) { TSCBLBuilderNoMaterial tscblBuilder; - for(size_t iColl=0; iColl < seedTokens_.size(); ++iColl) { + for (size_t iColl = 0; iColl < seedTokens_.size(); ++iColl) { const auto& seedToken = seedTokens_[iColl]; - edm::Handle > seedTracksHandle; + edm::Handle> seedTracksHandle; iEvent.getByToken(seedToken, seedTracksHandle); const auto& seedTracks = *seedTracksHandle; - if(seedTracks.empty()) + if (seedTracks.empty()) continue; edm::EDConsumerBase::Labels labels; labelsForToken(seedToken, labels); const auto& seedStopInfoToken = seedStopInfoTokens_[iColl]; - edm::Handle > seedStopInfoHandle; + edm::Handle> seedStopInfoHandle; iEvent.getByToken(seedStopInfoToken, seedStopInfoHandle); const auto& seedStopInfos = *seedStopInfoHandle; - if(seedTracks.size() != seedStopInfos.size()) { + if (seedTracks.size() != seedStopInfos.size()) { edm::EDConsumerBase::Labels labels2; labelsForToken(seedStopInfoToken, labels2); - - throw cms::Exception("LogicError") << "Got " << seedTracks.size() << " seeds, but " << seedStopInfos.size() << " seed stopping infos for collections " << labels.module << ", " << labels2.module; + + throw cms::Exception("LogicError") << "Got " << seedTracks.size() << " seeds, but " << seedStopInfos.size() + << " seed stopping infos for collections " << labels.module << ", " + << labels2.module; } // The associator interfaces really need to be fixed... edm::RefToBaseVector seedTrackRefs; - for(edm::View::size_type i=0; i::size_type i = 0; i < seedTracks.size(); ++i) { seedTrackRefs.push_back(seedTracks.refAt(i)); } reco::RecoToSimCollection recSimColl = associatorByHits.associateRecoToSim(seedTrackRefs, tpCollection); @@ -2727,21 +2804,23 @@ void TrackingNtuple::fillSeeds(const edm::Event& iEvent, TString label = labels.module; //format label to match algoName label.ReplaceAll("seedTracks", ""); - label.ReplaceAll("Seeds",""); - label.ReplaceAll("muonSeeded","muonSeededStep"); + label.ReplaceAll("Seeds", ""); + label.ReplaceAll("muonSeeded", "muonSeededStep"); int algo = reco::TrackBase::algoByName(label.Data()); edm::ProductID id = seedTracks[0].seedRef().id(); const auto offset = see_fitok.size(); auto inserted = seedCollToOffset.emplace(id, offset); - if(!inserted.second) - throw cms::Exception("Configuration") << "Trying to add seeds with ProductID " << id << " for a second time from collection " << labels.module << ", seed algo " << label << ". Typically this is caused by a configuration problem."; + if (!inserted.second) + throw cms::Exception("Configuration") + << "Trying to add seeds with ProductID " << id << " for a second time from collection " << labels.module + << ", seed algo " << label << ". Typically this is caused by a configuration problem."; see_offset.push_back(offset); LogTrace("TrackingNtuple") << "NEW SEED LABEL: " << label << " size: " << seedTracks.size() << " algo=" << algo << " ProductID " << id; - for(size_t iSeed=0; iSeed < seedTrackRefs.size(); ++iSeed) { + for (size_t iSeed = 0; iSeed < seedTrackRefs.size(); ++iSeed) { const auto& seedTrackRef = seedTrackRefs[iSeed]; const auto& seedTrack = *seedTrackRef; const auto& seedRef = seedTrack.seedRef(); @@ -2749,58 +2828,67 @@ void TrackingNtuple::fillSeeds(const edm::Event& iEvent, const auto seedStopInfo = seedStopInfos[iSeed]; - if(seedRef.id() != id) - throw cms::Exception("LogicError") << "All tracks in 'TracksFromSeeds' collection should point to seeds in the same collection. Now the element 0 had ProductID " << id << " while the element " << seedTrackRef.key() << " had " << seedTrackRef.id() << ". The source collection is " << labels.module << "."; + if (seedRef.id() != id) + throw cms::Exception("LogicError") + << "All tracks in 'TracksFromSeeds' collection should point to seeds in the same collection. Now the " + "element 0 had ProductID " + << id << " while the element " << seedTrackRef.key() << " had " << seedTrackRef.id() + << ". The source collection is " << labels.module << "."; std::vector tpIdx; std::vector sharedFraction; auto foundTPs = recSimColl.find(seedTrackRef); if (foundTPs != recSimColl.end()) { - for(const auto tpQuality: foundTPs->val) { - tpIdx.push_back( tpKeyToIndex.at( tpQuality.first.key() ) ); + for (const auto tpQuality : foundTPs->val) { + tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key())); sharedFraction.push_back(tpQuality.second); } } // Search for a best-matching TrackingParticle for a seed const int nHits = seedTrack.numberOfValidHits(); - const auto clusters = track_associator::hitsToClusterRefs(seedTrack.recHitsBegin(), seedTrack.recHitsEnd()); // TODO: this function is called 3 times per track, try to reduce + const auto clusters = track_associator::hitsToClusterRefs( + seedTrack.recHitsBegin(), + seedTrack.recHitsEnd()); // TODO: this function is called 3 times per track, try to reduce const int nClusters = clusters.size(); const auto bestKeyCount = findBestMatchingTrackingParticle(seedTrack, clusterToTPMap, tpKeyToIndex); - const float bestShareFrac = nClusters > 0 ? static_cast(bestKeyCount.countClusters)/static_cast(nClusters): 0; + const float bestShareFrac = + nClusters > 0 ? static_cast(bestKeyCount.countClusters) / static_cast(nClusters) : 0; // Another way starting from the first hit of the seed - const auto bestFirstHitKeyCount = findMatchingTrackingParticleFromFirstHit(seedTrack, clusterToTPMap, tpKeyToIndex); - const float bestFirstHitShareFrac = nClusters > 0 ? static_cast(bestFirstHitKeyCount.countClusters)/static_cast(nClusters) : 0; + const auto bestFirstHitKeyCount = + findMatchingTrackingParticleFromFirstHit(seedTrack, clusterToTPMap, tpKeyToIndex); + const float bestFirstHitShareFrac = + nClusters > 0 ? static_cast(bestFirstHitKeyCount.countClusters) / static_cast(nClusters) : 0; const bool seedFitOk = !trackFromSeedFitFailed(seedTrack); const int charge = seedTrack.charge(); - const float pt = seedFitOk ? seedTrack.pt() : 0; + const float pt = seedFitOk ? seedTrack.pt() : 0; const float eta = seedFitOk ? seedTrack.eta() : 0; const float phi = seedFitOk ? seedTrack.phi() : 0; const auto seedIndex = see_fitok.size(); - see_fitok .push_back(seedFitOk); - - see_px .push_back( seedFitOk ? seedTrack.px() : 0 ); - see_py .push_back( seedFitOk ? seedTrack.py() : 0 ); - see_pz .push_back( seedFitOk ? seedTrack.pz() : 0 ); - see_pt .push_back( pt ); - see_eta .push_back( eta ); - see_phi .push_back( phi ); - see_q .push_back( charge ); - see_nValid .push_back( nHits ); - - see_dxy .push_back( seedFitOk ? seedTrack.dxy(bs.position()) : 0); - see_dz .push_back( seedFitOk ? seedTrack.dz(bs.position()) : 0); - see_ptErr .push_back( seedFitOk ? seedTrack.ptError() : 0); - see_etaErr .push_back( seedFitOk ? seedTrack.etaError() : 0); - see_phiErr .push_back( seedFitOk ? seedTrack.phiError() : 0); - see_dxyErr .push_back( seedFitOk ? seedTrack.dxyError() : 0); - see_dzErr .push_back( seedFitOk ? seedTrack.dzError() : 0); - see_algo .push_back( algo ); - see_stopReason.push_back( seedStopInfo.stopReasonUC() ); - see_nCands .push_back( seedStopInfo.candidatesPerSeed() ); + see_fitok.push_back(seedFitOk); + + see_px.push_back(seedFitOk ? seedTrack.px() : 0); + see_py.push_back(seedFitOk ? seedTrack.py() : 0); + see_pz.push_back(seedFitOk ? seedTrack.pz() : 0); + see_pt.push_back(pt); + see_eta.push_back(eta); + see_phi.push_back(phi); + see_q.push_back(charge); + see_nValid.push_back(nHits); + + see_dxy.push_back(seedFitOk ? seedTrack.dxy(bs.position()) : 0); + see_dz.push_back(seedFitOk ? seedTrack.dz(bs.position()) : 0); + see_ptErr.push_back(seedFitOk ? seedTrack.ptError() : 0); + see_etaErr.push_back(seedFitOk ? seedTrack.etaError() : 0); + see_phiErr.push_back(seedFitOk ? seedTrack.phiError() : 0); + see_dxyErr.push_back(seedFitOk ? seedTrack.dxyError() : 0); + see_dzErr.push_back(seedFitOk ? seedTrack.dzError() : 0); + see_algo.push_back(algo); + see_stopReason.push_back(seedStopInfo.stopReasonUC()); + see_nCands.push_back(seedStopInfo.candidatesPerSeed()); const auto& state = seedTrack.seedRef()->startingState(); const auto& pos = state.parameters().position(); @@ -2812,14 +2900,14 @@ void TrackingNtuple::fillSeeds(const edm::Event& iEvent, see_stateTrajPy.push_back(mom.y()); see_stateTrajPz.push_back(mom.z()); - see_trkIdx .push_back(-1); // to be set correctly in fillTracks - if(includeTrackingParticles_) { - see_simTrkIdx.push_back( tpIdx ); - see_simTrkShareFrac.push_back( sharedFraction ); + see_trkIdx.push_back(-1); // to be set correctly in fillTracks + if (includeTrackingParticles_) { + see_simTrkIdx.push_back(tpIdx); + see_simTrkShareFrac.push_back(sharedFraction); see_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1); - see_bestFromFirstHitSimTrkIdx.push_back(bestFirstHitKeyCount.key >= 0 ? tpKeyToIndex.at(bestFirstHitKeyCount.key) : -1); - } - else { + see_bestFromFirstHitSimTrkIdx.push_back( + bestFirstHitKeyCount.key >= 0 ? tpKeyToIndex.at(bestFirstHitKeyCount.key) : -1); + } else { see_isTrue.push_back(!tpIdx.empty()); } see_bestSimTrkShareFrac.push_back(bestShareFrac); @@ -2840,36 +2928,36 @@ void TrackingNtuple::fillSeeds(const edm::Event& iEvent, std::vector hitIdx; std::vector hitType; - for (auto hit=seed.recHits().first; hit!=seed.recHits().second; ++hit) { - TransientTrackingRecHit::RecHitPointer recHit = theTTRHBuilder.build(&*hit); - int subid = recHit->geographicalId().subdetId(); - if (subid == (int) PixelSubdetector::PixelBarrel || subid == (int) PixelSubdetector::PixelEndcap) { - const BaseTrackerRecHit* bhit = dynamic_cast(&*recHit); + for (auto hit = seed.recHits().first; hit != seed.recHits().second; ++hit) { + TransientTrackingRecHit::RecHitPointer recHit = theTTRHBuilder.build(&*hit); + int subid = recHit->geographicalId().subdetId(); + if (subid == (int)PixelSubdetector::PixelBarrel || subid == (int)PixelSubdetector::PixelEndcap) { + const BaseTrackerRecHit* bhit = dynamic_cast(&*recHit); const auto& clusterRef = bhit->firstClusterRef(); const auto clusterKey = clusterRef.cluster_pixel().key(); - if(includeAllHits_) { + if (includeAllHits_) { checkProductID(hitProductIds, clusterRef.id(), "seed"); pix_seeIdx[clusterKey].push_back(seedIndex); } - hitIdx.push_back( clusterKey ); - hitType.push_back( static_cast(HitType::Pixel) ); - } else if (subid == (int) StripSubdetector::TOB || subid == (int) StripSubdetector::TID || - subid == (int) StripSubdetector::TIB || subid == (int) StripSubdetector::TEC) { - if (trackerHitRTTI::isMatched(*recHit)) { - const SiStripMatchedRecHit2D * matchedHit = dynamic_cast(&*recHit); - if(includeAllHits_) { + hitIdx.push_back(clusterKey); + hitType.push_back(static_cast(HitType::Pixel)); + } else if (subid == (int)StripSubdetector::TOB || subid == (int)StripSubdetector::TID || + subid == (int)StripSubdetector::TIB || subid == (int)StripSubdetector::TEC) { + if (trackerHitRTTI::isMatched(*recHit)) { + const SiStripMatchedRecHit2D* matchedHit = dynamic_cast(&*recHit); + if (includeAllHits_) { checkProductID(hitProductIds, matchedHit->monoClusterRef().id(), "seed"); checkProductID(hitProductIds, matchedHit->stereoClusterRef().id(), "seed"); } - int monoIdx = matchedHit->monoClusterRef().key(); - int stereoIdx = matchedHit->stereoClusterRef().key(); + int monoIdx = matchedHit->monoClusterRef().key(); + int stereoIdx = matchedHit->stereoClusterRef().key(); - std::vector >::iterator pos = find( monoStereoClusterList.begin(), monoStereoClusterList.end(), std::make_pair(monoIdx,stereoIdx) ); + std::vector>::iterator pos = + find(monoStereoClusterList.begin(), monoStereoClusterList.end(), std::make_pair(monoIdx, stereoIdx)); size_t gluedIndex = -1; - if(pos != monoStereoClusterList.end()) { + if (pos != monoStereoClusterList.end()) { gluedIndex = std::distance(monoStereoClusterList.begin(), pos); - } - else { + } else { // We can encounter glued hits not in the input // SiStripMatchedRecHit2DCollection, e.g. via muon // outside-in seeds (or anything taking hits from @@ -2877,106 +2965,129 @@ void TrackingNtuple::fillSeeds(const edm::Event& iEvent, gluedIndex = addStripMatchedHit(*matchedHit, theTTRHBuilder, tTopo, monoStereoClusterList); } - if(includeAllHits_) glu_seeIdx[gluedIndex].push_back(seedIndex); - hitIdx.push_back( gluedIndex ); - hitType.push_back( static_cast(HitType::Glued) ); - } else { - const BaseTrackerRecHit* bhit = dynamic_cast(&*recHit); + if (includeAllHits_) + glu_seeIdx[gluedIndex].push_back(seedIndex); + hitIdx.push_back(gluedIndex); + hitType.push_back(static_cast(HitType::Glued)); + } else { + const BaseTrackerRecHit* bhit = dynamic_cast(&*recHit); const auto& clusterRef = bhit->firstClusterRef(); unsigned int clusterKey; - if(clusterRef.isPhase2()){ + if (clusterRef.isPhase2()) { clusterKey = clusterRef.cluster_phase2OT().key(); } else { clusterKey = clusterRef.cluster_strip().key(); } - if(includeAllHits_) { + if (includeAllHits_) { checkProductID(hitProductIds, clusterRef.id(), "seed"); - if(clusterRef.isPhase2()){ + if (clusterRef.isPhase2()) { ph2_seeIdx[clusterKey].push_back(seedIndex); } else { str_seeIdx[clusterKey].push_back(seedIndex); } } - hitIdx.push_back( clusterKey ); - if(clusterRef.isPhase2()){ - hitType.push_back( static_cast(HitType::Phase2OT) ); + hitIdx.push_back(clusterKey); + if (clusterRef.isPhase2()) { + hitType.push_back(static_cast(HitType::Phase2OT)); } else { - hitType.push_back( static_cast(HitType::Strip) ); + hitType.push_back(static_cast(HitType::Strip)); } - } - } else { + } + } else { LogTrace("TrackingNtuple") << " not pixel and not Strip detector"; } } - see_hitIdx .push_back( hitIdx ); - see_hitType .push_back( hitType ); - see_nPixel .push_back( std::count(hitType.begin(), hitType.end(), static_cast(HitType::Pixel)) ); - see_nGlued .push_back( std::count(hitType.begin(), hitType.end(), static_cast(HitType::Glued)) ); - see_nStrip .push_back( std::count(hitType.begin(), hitType.end(), static_cast(HitType::Strip)) ); - see_nPhase2OT.push_back( std::count(hitType.begin(), hitType.end(), static_cast(HitType::Phase2OT)) ); - see_nCluster .push_back( nClusters ); + see_hitIdx.push_back(hitIdx); + see_hitType.push_back(hitType); + see_nPixel.push_back(std::count(hitType.begin(), hitType.end(), static_cast(HitType::Pixel))); + see_nGlued.push_back(std::count(hitType.begin(), hitType.end(), static_cast(HitType::Glued))); + see_nStrip.push_back(std::count(hitType.begin(), hitType.end(), static_cast(HitType::Strip))); + see_nPhase2OT.push_back(std::count(hitType.begin(), hitType.end(), static_cast(HitType::Phase2OT))); + see_nCluster.push_back(nClusters); //the part below is not strictly needed float chi2 = -1; - if (nHits==2) { - TransientTrackingRecHit::RecHitPointer recHit0 = theTTRHBuilder.build(&*(seed.recHits().first)); - TransientTrackingRecHit::RecHitPointer recHit1 = theTTRHBuilder.build(&*(seed.recHits().first+1)); + if (nHits == 2) { + TransientTrackingRecHit::RecHitPointer recHit0 = theTTRHBuilder.build(&*(seed.recHits().first)); + TransientTrackingRecHit::RecHitPointer recHit1 = theTTRHBuilder.build(&*(seed.recHits().first + 1)); std::vector gp(2); std::vector ge(2); - gp[0] = recHit0->globalPosition(); - ge[0] = recHit0->globalPositionError(); - gp[1] = recHit1->globalPosition(); - ge[1] = recHit1->globalPositionError(); - LogTrace("TrackingNtuple") << "seed " << seedTrackRef.key() - << " pt=" << pt << " eta=" << eta << " phi=" << phi << " q=" << charge - << " - PAIR - ids: " << recHit0->geographicalId().rawId() << " " << recHit1->geographicalId().rawId() - << " hitpos: " << gp[0] << " " << gp[1] - << " trans0: " << (recHit0->transientHits().size()>1 ? recHit0->transientHits()[0]->globalPosition() : GlobalPoint(0,0,0)) - << " " << (recHit0->transientHits().size()>1 ? recHit0->transientHits()[1]->globalPosition() : GlobalPoint(0,0,0)) - << " trans1: " << (recHit1->transientHits().size()>1 ? recHit1->transientHits()[0]->globalPosition() : GlobalPoint(0,0,0)) - << " " << (recHit1->transientHits().size()>1 ? recHit1->transientHits()[1]->globalPosition() : GlobalPoint(0,0,0)) - << " eta,phi: " << gp[0].eta() << "," << gp[0].phi(); - } else if (nHits==3) { - TransientTrackingRecHit::RecHitPointer recHit0 = theTTRHBuilder.build(&*(seed.recHits().first)); - TransientTrackingRecHit::RecHitPointer recHit1 = theTTRHBuilder.build(&*(seed.recHits().first+1)); - TransientTrackingRecHit::RecHitPointer recHit2 = theTTRHBuilder.build(&*(seed.recHits().first+2)); - declareDynArray(GlobalPoint,4, gp); - declareDynArray(GlobalError,4, ge); - declareDynArray(bool,4, bl); - gp[0] = recHit0->globalPosition(); - ge[0] = recHit0->globalPositionError(); - int subid0 = recHit0->geographicalId().subdetId(); - bl[0] = (subid0 == StripSubdetector::TIB || subid0 == StripSubdetector::TOB || subid0 == (int) PixelSubdetector::PixelBarrel); - gp[1] = recHit1->globalPosition(); - ge[1] = recHit1->globalPositionError(); - int subid1 = recHit1->geographicalId().subdetId(); - bl[1] = (subid1 == StripSubdetector::TIB || subid1 == StripSubdetector::TOB || subid1 == (int) PixelSubdetector::PixelBarrel); - gp[2] = recHit2->globalPosition(); - ge[2] = recHit2->globalPositionError(); - int subid2 = recHit2->geographicalId().subdetId(); - bl[2] = (subid2 == StripSubdetector::TIB || subid2 == StripSubdetector::TOB || subid2 == (int) PixelSubdetector::PixelBarrel); - RZLine rzLine(gp,ge,bl); - float seed_chi2 = rzLine.chi2(); - //float seed_pt = state.globalParameters().momentum().perp(); + gp[0] = recHit0->globalPosition(); + ge[0] = recHit0->globalPositionError(); + gp[1] = recHit1->globalPosition(); + ge[1] = recHit1->globalPositionError(); + LogTrace("TrackingNtuple") + << "seed " << seedTrackRef.key() << " pt=" << pt << " eta=" << eta << " phi=" << phi << " q=" << charge + << " - PAIR - ids: " << recHit0->geographicalId().rawId() << " " << recHit1->geographicalId().rawId() + << " hitpos: " << gp[0] << " " << gp[1] << " trans0: " + << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[0]->globalPosition() + : GlobalPoint(0, 0, 0)) + << " " + << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[1]->globalPosition() + : GlobalPoint(0, 0, 0)) + << " trans1: " + << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[0]->globalPosition() + : GlobalPoint(0, 0, 0)) + << " " + << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[1]->globalPosition() + : GlobalPoint(0, 0, 0)) + << " eta,phi: " << gp[0].eta() << "," << gp[0].phi(); + } else if (nHits == 3) { + TransientTrackingRecHit::RecHitPointer recHit0 = theTTRHBuilder.build(&*(seed.recHits().first)); + TransientTrackingRecHit::RecHitPointer recHit1 = theTTRHBuilder.build(&*(seed.recHits().first + 1)); + TransientTrackingRecHit::RecHitPointer recHit2 = theTTRHBuilder.build(&*(seed.recHits().first + 2)); + declareDynArray(GlobalPoint, 4, gp); + declareDynArray(GlobalError, 4, ge); + declareDynArray(bool, 4, bl); + gp[0] = recHit0->globalPosition(); + ge[0] = recHit0->globalPositionError(); + int subid0 = recHit0->geographicalId().subdetId(); + bl[0] = (subid0 == StripSubdetector::TIB || subid0 == StripSubdetector::TOB || + subid0 == (int)PixelSubdetector::PixelBarrel); + gp[1] = recHit1->globalPosition(); + ge[1] = recHit1->globalPositionError(); + int subid1 = recHit1->geographicalId().subdetId(); + bl[1] = (subid1 == StripSubdetector::TIB || subid1 == StripSubdetector::TOB || + subid1 == (int)PixelSubdetector::PixelBarrel); + gp[2] = recHit2->globalPosition(); + ge[2] = recHit2->globalPositionError(); + int subid2 = recHit2->geographicalId().subdetId(); + bl[2] = (subid2 == StripSubdetector::TIB || subid2 == StripSubdetector::TOB || + subid2 == (int)PixelSubdetector::PixelBarrel); + RZLine rzLine(gp, ge, bl); + float seed_chi2 = rzLine.chi2(); + //float seed_pt = state.globalParameters().momentum().perp(); float seed_pt = pt; - LogTrace("TrackingNtuple") << "seed " << seedTrackRef.key() - << " pt=" << pt << " eta=" << eta << " phi=" << phi << " q=" << charge - << " - TRIPLET - ids: " << recHit0->geographicalId().rawId() << " " << recHit1->geographicalId().rawId() << " " << recHit2->geographicalId().rawId() - << " hitpos: " << gp[0] << " " << gp[1] << " " << gp[2] - << " trans0: " << (recHit0->transientHits().size()>1 ? recHit0->transientHits()[0]->globalPosition() : GlobalPoint(0,0,0)) - << " " << (recHit0->transientHits().size()>1 ? recHit0->transientHits()[1]->globalPosition() : GlobalPoint(0,0,0)) - << " trans1: " << (recHit1->transientHits().size()>1 ? recHit1->transientHits()[0]->globalPosition() : GlobalPoint(0,0,0)) - << " " << (recHit1->transientHits().size()>1 ? recHit1->transientHits()[1]->globalPosition() : GlobalPoint(0,0,0)) - << " trans2: " << (recHit2->transientHits().size()>1 ? recHit2->transientHits()[0]->globalPosition() : GlobalPoint(0,0,0)) - << " " << (recHit2->transientHits().size()>1 ? recHit2->transientHits()[1]->globalPosition() : GlobalPoint(0,0,0)) - << " local: " << recHit2->localPosition() - //<< " tsos pos, mom: " << state.globalPosition()<<" "<geographicalId().rawId() << " " << recHit1->geographicalId().rawId() + << " " << recHit2->geographicalId().rawId() << " hitpos: " << gp[0] << " " << gp[1] << " " << gp[2] + << " trans0: " + << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[0]->globalPosition() + : GlobalPoint(0, 0, 0)) + << " " + << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[1]->globalPosition() + : GlobalPoint(0, 0, 0)) + << " trans1: " + << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[0]->globalPosition() + : GlobalPoint(0, 0, 0)) + << " " + << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[1]->globalPosition() + : GlobalPoint(0, 0, 0)) + << " trans2: " + << (recHit2->transientHits().size() > 1 ? recHit2->transientHits()[0]->globalPosition() + : GlobalPoint(0, 0, 0)) + << " " + << (recHit2->transientHits().size() > 1 ? recHit2->transientHits()[1]->globalPosition() + : GlobalPoint(0, 0, 0)) + << " local: " + << recHit2->localPosition() + //<< " tsos pos, mom: " << state.globalPosition()<<" "<& tracks, const TrackerTopology& tTopo, const std::set& hitProductIds, const std::map& seedCollToOffset, - const std::vector& mvaColls, - const std::vector& qualColls - ) { + const std::vector& mvaColls, + const std::vector& qualColls) { reco::RecoToSimCollection recSimColl = associatorByHits.associateRecoToSim(tracks, tpCollection); edm::EDConsumerBase::Labels labels; labelsForToken(trackToken_, labels); @@ -3006,7 +3116,7 @@ void TrackingNtuple::fillTracks(const edm::RefToBaseVector& tracks, auto pvPosition = vertices[0].position(); - for(size_t iTrack = 0; iTrackcharge(); float pt = itTrack->pt(); @@ -3031,59 +3141,70 @@ void TrackingNtuple::fillTracks(const edm::RefToBaseVector& tracks, auto foundTPs = recSimColl.find(itTrack); if (foundTPs != recSimColl.end()) { if (!foundTPs->val.empty()) { - nSimHits = foundTPs->val[0].first->numberOfTrackerHits(); - isSimMatched = true; + nSimHits = foundTPs->val[0].first->numberOfTrackerHits(); + isSimMatched = true; } - for(const auto tpQuality: foundTPs->val) { - tpIdx.push_back( tpKeyToIndex.at( tpQuality.first.key() ) ); + for (const auto tpQuality : foundTPs->val) { + tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key())); sharedFraction.push_back(tpQuality.second); tpChi2.push_back(track_associator::trackAssociationChi2(tkParam, tkCov, *(tpCollection[tpIdx.back()]), mf, bs)); } } // Search for a best-matching TrackingParticle for a track - const auto clusters = track_associator::hitsToClusterRefs(itTrack->recHitsBegin(), itTrack->recHitsEnd()); // TODO: this function is called 3 times per track, try to reduce + const auto clusters = track_associator::hitsToClusterRefs( + itTrack->recHitsBegin(), + itTrack->recHitsEnd()); // TODO: this function is called 3 times per track, try to reduce const int nClusters = clusters.size(); const auto bestKeyCount = findBestMatchingTrackingParticle(*itTrack, clusterToTPMap, tpKeyToIndex); - const float bestShareFrac = static_cast(bestKeyCount.countClusters)/static_cast(nClusters); + const float bestShareFrac = static_cast(bestKeyCount.countClusters) / static_cast(nClusters); float bestShareFracSimDenom = 0; float bestShareFracSimClusterDenom = 0; float bestChi2 = -1; - if(bestKeyCount.key >= 0) { - bestShareFracSimDenom = static_cast(bestKeyCount.countClusters)/static_cast(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]->numberOfTrackerHits()); - bestShareFracSimClusterDenom = static_cast(bestKeyCount.countClusters)/static_cast(tpKeyToClusterCount.at(bestKeyCount.key)); - bestChi2 = track_associator::trackAssociationChi2(tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]), mf, bs); + if (bestKeyCount.key >= 0) { + bestShareFracSimDenom = + static_cast(bestKeyCount.countClusters) / + static_cast(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]->numberOfTrackerHits()); + bestShareFracSimClusterDenom = + static_cast(bestKeyCount.countClusters) / static_cast(tpKeyToClusterCount.at(bestKeyCount.key)); + bestChi2 = track_associator::trackAssociationChi2( + tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]), mf, bs); } // Another way starting from the first hit of the track const auto bestFirstHitKeyCount = findMatchingTrackingParticleFromFirstHit(*itTrack, clusterToTPMap, tpKeyToIndex); - const float bestFirstHitShareFrac = static_cast(bestFirstHitKeyCount.countClusters)/static_cast(nClusters); + const float bestFirstHitShareFrac = + static_cast(bestFirstHitKeyCount.countClusters) / static_cast(nClusters); float bestFirstHitShareFracSimDenom = 0; float bestFirstHitShareFracSimClusterDenom = 0; float bestFirstHitChi2 = -1; - if(bestFirstHitKeyCount.key >= 0) { - bestFirstHitShareFracSimDenom = static_cast(bestFirstHitKeyCount.countClusters)/static_cast(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]->numberOfTrackerHits()); - bestFirstHitShareFracSimClusterDenom = static_cast(bestFirstHitKeyCount.countClusters)/static_cast(tpKeyToClusterCount.at(bestFirstHitKeyCount.key)); - bestFirstHitChi2 = track_associator::trackAssociationChi2(tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]), mf, bs); + if (bestFirstHitKeyCount.key >= 0) { + bestFirstHitShareFracSimDenom = + static_cast(bestFirstHitKeyCount.countClusters) / + static_cast(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]->numberOfTrackerHits()); + bestFirstHitShareFracSimClusterDenom = static_cast(bestFirstHitKeyCount.countClusters) / + static_cast(tpKeyToClusterCount.at(bestFirstHitKeyCount.key)); + bestFirstHitChi2 = track_associator::trackAssociationChi2( + tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]), mf, bs); } float chi2_1Dmod = chi2; int count1dhits = 0; - for(auto iHit = itTrack->recHitsBegin(), iEnd=itTrack->recHitsEnd(); iHit != iEnd; ++iHit) { + for (auto iHit = itTrack->recHitsBegin(), iEnd = itTrack->recHitsEnd(); iHit != iEnd; ++iHit) { const TrackingRecHit& hit = **iHit; - if(hit.isValid() && typeid(hit) == typeid(SiStripRecHit1D)) + if (hit.isValid() && typeid(hit) == typeid(SiStripRecHit1D)) ++count1dhits; } - if(count1dhits > 0) { - chi2_1Dmod = (chi2+count1dhits)/(ndof+count1dhits); + if (count1dhits > 0) { + chi2_1Dmod = (chi2 + count1dhits) / (ndof + count1dhits); } Point bestPV = getBestVertex(*itTrack, vertices); - trk_px .push_back(itTrack->px()); - trk_py .push_back(itTrack->py()); - trk_pz .push_back(itTrack->pz()); - trk_pt .push_back(pt); + trk_px.push_back(itTrack->px()); + trk_py.push_back(itTrack->py()); + trk_pz.push_back(itTrack->pz()); + trk_pt.push_back(pt); trk_inner_px.push_back(itTrack->innerMomentum().x()); trk_inner_py.push_back(itTrack->innerMomentum().y()); trk_inner_pz.push_back(itTrack->innerMomentum().z()); @@ -3092,79 +3213,82 @@ void TrackingNtuple::fillTracks(const edm::RefToBaseVector& tracks, trk_outer_py.push_back(itTrack->outerMomentum().y()); trk_outer_pz.push_back(itTrack->outerMomentum().z()); trk_outer_pt.push_back(itTrack->outerMomentum().rho()); - trk_eta .push_back(eta); - trk_lambda .push_back(lambda); - trk_cotTheta .push_back(1/tan(M_PI*0.5-lambda)); - trk_phi .push_back(phi); - trk_dxy .push_back(itTrack->dxy(bs.position())); - trk_dz .push_back(itTrack->dz(bs.position())); - trk_dxyPV .push_back(itTrack->dxy(pvPosition)); - trk_dzPV .push_back(itTrack->dz(pvPosition)); + trk_eta.push_back(eta); + trk_lambda.push_back(lambda); + trk_cotTheta.push_back(1 / tan(M_PI * 0.5 - lambda)); + trk_phi.push_back(phi); + trk_dxy.push_back(itTrack->dxy(bs.position())); + trk_dz.push_back(itTrack->dz(bs.position())); + trk_dxyPV.push_back(itTrack->dxy(pvPosition)); + trk_dzPV.push_back(itTrack->dz(pvPosition)); trk_dxyClosestPV.push_back(itTrack->dxy(bestPV)); - trk_dzClosestPV .push_back(itTrack->dz(bestPV)); - trk_ptErr .push_back(itTrack->ptError()); - trk_etaErr .push_back(itTrack->etaError()); + trk_dzClosestPV.push_back(itTrack->dz(bestPV)); + trk_ptErr.push_back(itTrack->ptError()); + trk_etaErr.push_back(itTrack->etaError()); trk_lambdaErr.push_back(itTrack->lambdaError()); - trk_phiErr .push_back(itTrack->phiError()); - trk_dxyErr .push_back(itTrack->dxyError()); - trk_dzErr .push_back(itTrack->dzError()); + trk_phiErr.push_back(itTrack->phiError()); + trk_dxyErr.push_back(itTrack->dxyError()); + trk_dzErr.push_back(itTrack->dzError()); trk_refpoint_x.push_back(itTrack->vx()); trk_refpoint_y.push_back(itTrack->vy()); trk_refpoint_z.push_back(itTrack->vz()); - trk_nChi2 .push_back(chi2); + trk_nChi2.push_back(chi2); trk_nChi2_1Dmod.push_back(chi2_1Dmod); - trk_ndof .push_back(ndof); - trk_q .push_back(charge); - trk_nValid .push_back(hp.numberOfValidHits()); - trk_nLost .push_back(hp.numberOfLostHits(reco::HitPattern::TRACK_HITS)); - trk_nInactive .push_back(hp.trackerLayersTotallyOffOrBad(reco::HitPattern::TRACK_HITS)); - trk_nPixel .push_back(hp.numberOfValidPixelHits()); - trk_nStrip .push_back(hp.numberOfValidStripHits()); + trk_ndof.push_back(ndof); + trk_q.push_back(charge); + trk_nValid.push_back(hp.numberOfValidHits()); + trk_nLost.push_back(hp.numberOfLostHits(reco::HitPattern::TRACK_HITS)); + trk_nInactive.push_back(hp.trackerLayersTotallyOffOrBad(reco::HitPattern::TRACK_HITS)); + trk_nPixel.push_back(hp.numberOfValidPixelHits()); + trk_nStrip.push_back(hp.numberOfValidStripHits()); trk_nOuterLost.push_back(hp.numberOfLostTrackerHits(reco::HitPattern::MISSING_OUTER_HITS)); trk_nInnerLost.push_back(hp.numberOfLostTrackerHits(reco::HitPattern::MISSING_INNER_HITS)); trk_nOuterInactive.push_back(hp.trackerLayersTotallyOffOrBad(reco::HitPattern::MISSING_OUTER_HITS)); trk_nInnerInactive.push_back(hp.trackerLayersTotallyOffOrBad(reco::HitPattern::MISSING_INNER_HITS)); trk_nPixelLay.push_back(hp.pixelLayersWithMeasurement()); trk_nStripLay.push_back(hp.stripLayersWithMeasurement()); - trk_n3DLay .push_back(hp.numberOfValidStripLayersWithMonoAndStereo()+hp.pixelLayersWithMeasurement()); - trk_nLostLay .push_back(hp.trackerLayersWithoutMeasurement(reco::HitPattern::TRACK_HITS)); - trk_nCluster .push_back(nClusters); - trk_algo .push_back(itTrack->algo()); + trk_n3DLay.push_back(hp.numberOfValidStripLayersWithMonoAndStereo() + hp.pixelLayersWithMeasurement()); + trk_nLostLay.push_back(hp.trackerLayersWithoutMeasurement(reco::HitPattern::TRACK_HITS)); + trk_nCluster.push_back(nClusters); + trk_algo.push_back(itTrack->algo()); trk_originalAlgo.push_back(itTrack->originalAlgo()); - trk_algoMask .push_back(itTrack->algoMaskUL()); + trk_algoMask.push_back(itTrack->algoMaskUL()); trk_stopReason.push_back(itTrack->stopReason()); - trk_isHP .push_back(itTrack->quality(reco::TrackBase::highPurity)); - if(includeMVA_) { - for(size_t i=0; iquality(reco::TrackBase::highPurity)); + if (includeMVA_) { + for (size_t i = 0; i < trk_mvas.size(); ++i) { + trk_mvas[i].push_back((*(mvaColls[i]))[iTrack]); + trk_qualityMasks[i].push_back((*(qualColls[i]))[iTrack]); } } - if(includeSeeds_) { + if (includeSeeds_) { auto offset = seedCollToOffset.find(itTrack->seedRef().id()); - if(offset == seedCollToOffset.end()) { - throw cms::Exception("Configuration") << "Track algo '" << reco::TrackBase::algoName(itTrack->algo()) - << "' originalAlgo '" << reco::TrackBase::algoName(itTrack->originalAlgo()) - << "' refers to seed collection " << itTrack->seedRef().id() - << ", but that seed collection is not given as an input. The following collections were given as an input " << make_ProductIDMapPrinter(seedCollToOffset); + if (offset == seedCollToOffset.end()) { + throw cms::Exception("Configuration") + << "Track algo '" << reco::TrackBase::algoName(itTrack->algo()) << "' originalAlgo '" + << reco::TrackBase::algoName(itTrack->originalAlgo()) << "' refers to seed collection " + << itTrack->seedRef().id() + << ", but that seed collection is not given as an input. The following collections were given as an input " + << make_ProductIDMapPrinter(seedCollToOffset); } const auto seedIndex = offset->second + itTrack->seedRef().key(); - trk_seedIdx .push_back(seedIndex); - if(see_trkIdx[seedIndex] != -1) { - throw cms::Exception("LogicError") << "Track index has already been set for seed " << seedIndex << " to " << see_trkIdx[seedIndex] << "; was trying to set it to " << iTrack; + trk_seedIdx.push_back(seedIndex); + if (see_trkIdx[seedIndex] != -1) { + throw cms::Exception("LogicError") << "Track index has already been set for seed " << seedIndex << " to " + << see_trkIdx[seedIndex] << "; was trying to set it to " << iTrack; } see_trkIdx[seedIndex] = iTrack; } - trk_vtxIdx .push_back(-1); // to be set correctly in fillVertices - if(includeTrackingParticles_) { + trk_vtxIdx.push_back(-1); // to be set correctly in fillVertices + if (includeTrackingParticles_) { trk_simTrkIdx.push_back(tpIdx); trk_simTrkShareFrac.push_back(sharedFraction); trk_simTrkNChi2.push_back(tpChi2); trk_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1); - trk_bestFromFirstHitSimTrkIdx.push_back(bestFirstHitKeyCount.key >= 0 ? tpKeyToIndex.at(bestFirstHitKeyCount.key) : -1); - } - else { + trk_bestFromFirstHitSimTrkIdx.push_back(bestFirstHitKeyCount.key >= 0 ? tpKeyToIndex.at(bestFirstHitKeyCount.key) + : -1); + } else { trk_isTrue.push_back(!tpIdx.empty()); } trk_bestSimTrkShareFrac.push_back(bestShareFrac); @@ -3176,25 +3300,23 @@ void TrackingNtuple::fillTracks(const edm::RefToBaseVector& tracks, trk_bestFromFirstHitSimTrkShareFracSimClusterDenom.push_back(bestFirstHitShareFracSimClusterDenom); trk_bestFromFirstHitSimTrkNChi2.push_back(bestFirstHitChi2); - LogTrace("TrackingNtuple") << "Track #" << itTrack.key() << " with q=" << charge - << ", pT=" << pt << " GeV, eta: " << eta << ", phi: " << phi - << ", chi2=" << chi2 - << ", Nhits=" << nHits + LogTrace("TrackingNtuple") << "Track #" << itTrack.key() << " with q=" << charge << ", pT=" << pt + << " GeV, eta: " << eta << ", phi: " << phi << ", chi2=" << chi2 << ", Nhits=" << nHits << ", algo=" << itTrack->algoName(itTrack->algo()).c_str() << " hp=" << itTrack->quality(reco::TrackBase::highPurity) - << " seed#=" << itTrack->seedRef().key() - << " simMatch=" << isSimMatched + << " seed#=" << itTrack->seedRef().key() << " simMatch=" << isSimMatched << " nSimHits=" << nSimHits - << " sharedFraction=" << (sharedFraction.empty()?-1:sharedFraction[0]) - << " tpIdx=" << (tpIdx.empty()?-1:tpIdx[0]); + << " sharedFraction=" << (sharedFraction.empty() ? -1 : sharedFraction[0]) + << " tpIdx=" << (tpIdx.empty() ? -1 : tpIdx[0]); std::vector hitIdx; std::vector hitType; - for(auto i=itTrack->recHitsBegin(); i!=itTrack->recHitsEnd(); i++) { - TransientTrackingRecHit::RecHitPointer hit=theTTRHBuilder.build(&**i ); + for (auto i = itTrack->recHitsBegin(); i != itTrack->recHitsEnd(); i++) { + TransientTrackingRecHit::RecHitPointer hit = theTTRHBuilder.build(&**i); DetId hitId = hit->geographicalId(); - LogTrace("TrackingNtuple") << "hit #" << std::distance(itTrack->recHitsBegin(), i) << " subdet=" << hitId.subdetId(); - if(hitId.det() != DetId::Tracker) + LogTrace("TrackingNtuple") << "hit #" << std::distance(itTrack->recHitsBegin(), i) + << " subdet=" << hitId.subdetId(); + if (hitId.det() != DetId::Tracker) continue; LogTrace("TrackingNtuple") << " " << subdetstring(hitId.subdetId()) << " " << tTopo.layer(hitId); @@ -3204,49 +3326,48 @@ void TrackingNtuple::fillTracks(const edm::RefToBaseVector& tracks, const BaseTrackerRecHit* bhit = dynamic_cast(&*hit); const auto& clusterRef = bhit->firstClusterRef(); unsigned int clusterKey; - if(clusterRef.isPixel()){ + if (clusterRef.isPixel()) { clusterKey = clusterRef.cluster_pixel().key(); - } else if(clusterRef.isPhase2()){ + } else if (clusterRef.isPhase2()) { clusterKey = clusterRef.cluster_phase2OT().key(); } else { clusterKey = clusterRef.cluster_strip().key(); } LogTrace("TrackingNtuple") << " id: " << hitId.rawId() << " - globalPos =" << hit->globalPosition() - << " cluster=" << clusterKey - << " clusterRef ID=" << clusterRef.id() + << " cluster=" << clusterKey << " clusterRef ID=" << clusterRef.id() << " eta,phi: " << hit->globalPosition().eta() << "," << hit->globalPosition().phi(); - if(includeAllHits_) { + if (includeAllHits_) { checkProductID(hitProductIds, clusterRef.id(), "track"); - if(clusterRef.isPixel()){ + if (clusterRef.isPixel()) { pix_trkIdx[clusterKey].push_back(iTrack); - } else if(clusterRef.isPhase2()){ + } else if (clusterRef.isPhase2()) { ph2_trkIdx[clusterKey].push_back(iTrack); } else { str_trkIdx[clusterKey].push_back(iTrack); } - } hitIdx.push_back(clusterKey); - if(clusterRef.isPixel()){ - hitType.push_back( static_cast(HitType::Pixel)); - } else if(clusterRef.isPhase2()){ - hitType.push_back( static_cast(HitType::Phase2OT)); + if (clusterRef.isPixel()) { + hitType.push_back(static_cast(HitType::Pixel)); + } else if (clusterRef.isPhase2()) { + hitType.push_back(static_cast(HitType::Phase2OT)); } else { - hitType.push_back( static_cast(HitType::Strip)); + hitType.push_back(static_cast(HitType::Strip)); } - } else { + } else { LogTrace("TrackingNtuple") << " - invalid hit"; - hitIdx.push_back( inv_isBarrel.size() ); - hitType.push_back( static_cast(HitType::Invalid) ); - - inv_isBarrel.push_back( hitId.subdetId()==1 ); - if(includeStripHits_) inv_detId.push_back( tTopo, hitId ); - else inv_detId_phase2.push_back( tTopo, hitId ); - inv_type .push_back( hit->getType() ); + hitIdx.push_back(inv_isBarrel.size()); + hitType.push_back(static_cast(HitType::Invalid)); + inv_isBarrel.push_back(hitId.subdetId() == 1); + if (includeStripHits_) + inv_detId.push_back(tTopo, hitId); + else + inv_detId_phase2.push_back(tTopo, hitId); + inv_type.push_back(hit->getType()); } } @@ -3255,19 +3376,18 @@ void TrackingNtuple::fillTracks(const edm::RefToBaseVector& tracks, } } - -void TrackingNtuple::fillTrackingParticles(const edm::Event& iEvent, const edm::EventSetup& iSetup, +void TrackingNtuple::fillTrackingParticles(const edm::Event& iEvent, + const edm::EventSetup& iSetup, const edm::RefToBaseVector& tracks, const reco::BeamSpot& bs, const TrackingParticleRefVector& tpCollection, const TrackingVertexRefKeyToIndex& tvKeyToIndex, const reco::TrackToTrackingParticleAssociator& associatorByHits, const std::vector& tpHitList, - const TrackingParticleRefKeyToCount& tpKeyToClusterCount - ) { + const TrackingParticleRefKeyToCount& tpKeyToClusterCount) { edm::ESHandle parametersDefinerH; iSetup.get().get(parametersDefinerName_, parametersDefinerH); - const ParametersDefinerForTP *parametersDefiner = parametersDefinerH.product(); + const ParametersDefinerForTP* parametersDefiner = parametersDefinerH.product(); // Number of 3D layers for TPs edm::Handle> tpNLayersH; @@ -3282,113 +3402,116 @@ void TrackingNtuple::fillTrackingParticles(const edm::Event& iEvent, const edm:: reco::SimToRecoCollection simRecColl = associatorByHits.associateSimToReco(tracks, tpCollection); - for(const TrackingParticleRef& tp: tpCollection) { + for (const TrackingParticleRef& tp : tpCollection) { LogTrace("TrackingNtuple") << "tracking particle pt=" << tp->pt() << " eta=" << tp->eta() << " phi=" << tp->phi(); bool isRecoMatched = false; std::vector tkIdx; std::vector sharedFraction; auto foundTracks = simRecColl.find(tp); - if(foundTracks != simRecColl.end()) { + if (foundTracks != simRecColl.end()) { isRecoMatched = true; - for(const auto trackQuality: foundTracks->val) { + for (const auto trackQuality : foundTracks->val) { sharedFraction.push_back(trackQuality.second); tkIdx.push_back(trackQuality.first.key()); } } sim_genPdgIds.emplace_back(); - for(const auto& genRef: tp->genParticles()) { - if(genRef.isNonnull()) + for (const auto& genRef : tp->genParticles()) { + if (genRef.isNonnull()) sim_genPdgIds.back().push_back(genRef->pdgId()); } bool isFromBHadron = false; // Logic is similar to SimTracker/TrackHistory - if(tracer_.evaluate(tp)) { // ignore TP if history can not be traced + if (tracer_.evaluate(tp)) { // ignore TP if history can not be traced // following is from TrackClassifier::processesAtGenerator() - HistoryBase::RecoGenParticleTrail const & recoGenParticleTrail = tracer_.recoGenParticleTrail(); - for(const auto& particle: recoGenParticleTrail) { + HistoryBase::RecoGenParticleTrail const& recoGenParticleTrail = tracer_.recoGenParticleTrail(); + for (const auto& particle : recoGenParticleTrail) { HepPDT::ParticleID particleID(particle->pdgId()); - if(particleID.hasBottom()) { + if (particleID.hasBottom()) { isFromBHadron = true; break; } } } - LogTrace("TrackingNtuple") << "matched to tracks = " << make_VectorPrinter(tkIdx) << " isRecoMatched=" << isRecoMatched; - sim_event .push_back(tp->eventId().event()); + LogTrace("TrackingNtuple") << "matched to tracks = " << make_VectorPrinter(tkIdx) + << " isRecoMatched=" << isRecoMatched; + sim_event.push_back(tp->eventId().event()); sim_bunchCrossing.push_back(tp->eventId().bunchCrossing()); - sim_pdgId .push_back(tp->pdgId()); + sim_pdgId.push_back(tp->pdgId()); sim_isFromBHadron.push_back(isFromBHadron); - sim_px .push_back(tp->px()); - sim_py .push_back(tp->py()); - sim_pz .push_back(tp->pz()); - sim_pt .push_back(tp->pt()); - sim_eta .push_back(tp->eta()); - sim_phi .push_back(tp->phi()); - sim_q .push_back(tp->charge()); - sim_trkIdx .push_back(tkIdx); + sim_px.push_back(tp->px()); + sim_py.push_back(tp->py()); + sim_pz.push_back(tp->pz()); + sim_pt.push_back(tp->pt()); + sim_eta.push_back(tp->eta()); + sim_phi.push_back(tp->phi()); + sim_q.push_back(tp->charge()); + sim_trkIdx.push_back(tkIdx); sim_trkShareFrac.push_back(sharedFraction); - sim_parentVtxIdx.push_back( tvKeyToIndex.at(tp->parentVertex().key()) ); + sim_parentVtxIdx.push_back(tvKeyToIndex.at(tp->parentVertex().key())); std::vector decayIdx; - for(const auto& v: tp->decayVertices()) - decayIdx.push_back( tvKeyToIndex.at(v.key()) ); + for (const auto& v : tp->decayVertices()) + decayIdx.push_back(tvKeyToIndex.at(v.key())); sim_decayVtxIdx.push_back(decayIdx); //Calcualte the impact parameters w.r.t. PCA - TrackingParticle::Vector momentum = parametersDefiner->momentum(iEvent,iSetup,tp); - TrackingParticle::Point vertex = parametersDefiner->vertex(iEvent,iSetup,tp); + TrackingParticle::Vector momentum = parametersDefiner->momentum(iEvent, iSetup, tp); + TrackingParticle::Point vertex = parametersDefiner->vertex(iEvent, iSetup, tp); auto dxySim = TrackingParticleIP::dxy(vertex, momentum, bs.position()); auto dzSim = TrackingParticleIP::dz(vertex, momentum, bs.position()); - const double lambdaSim = M_PI/2 - momentum.theta(); - sim_pca_pt .push_back(std::sqrt(momentum.perp2())); - sim_pca_eta .push_back(momentum.Eta()); - sim_pca_lambda .push_back(lambdaSim); - sim_pca_cotTheta .push_back(1/tan(M_PI*0.5-lambdaSim)); - sim_pca_phi .push_back(momentum.phi()); - sim_pca_dxy .push_back(dxySim); - sim_pca_dz .push_back(dzSim); + const double lambdaSim = M_PI / 2 - momentum.theta(); + sim_pca_pt.push_back(std::sqrt(momentum.perp2())); + sim_pca_eta.push_back(momentum.Eta()); + sim_pca_lambda.push_back(lambdaSim); + sim_pca_cotTheta.push_back(1 / tan(M_PI * 0.5 - lambdaSim)); + sim_pca_phi.push_back(momentum.phi()); + sim_pca_dxy.push_back(dxySim); + sim_pca_dz.push_back(dzSim); std::vector hitIdx; - int nPixel=0, nStrip=0; + int nPixel = 0, nStrip = 0; auto rangeHit = std::equal_range(tpHitList.begin(), tpHitList.end(), TPHitIndex(tp.key()), tpHitIndexListLess); - for(auto ip = rangeHit.first; ip != rangeHit.second; ++ip) { + for (auto ip = rangeHit.first; ip != rangeHit.second; ++ip) { auto type = HitType::Unknown; - if(!simhit_hitType[ip->simHitIdx].empty()) + if (!simhit_hitType[ip->simHitIdx].empty()) type = static_cast(simhit_hitType[ip->simHitIdx][0]); LogTrace("TrackingNtuple") << "simhit=" << ip->simHitIdx << " type=" << static_cast(type); hitIdx.push_back(ip->simHitIdx); const auto detid = DetId(includeStripHits_ ? simhit_detId[ip->simHitIdx] : simhit_detId_phase2[ip->simHitIdx]); - if(detid.det() != DetId::Tracker) { - throw cms::Exception("LogicError") << "Encountered SimHit for TP " << tp.key() << " with DetId " << detid.rawId() << " whose det() is not Tracker but " << detid.det(); + if (detid.det() != DetId::Tracker) { + throw cms::Exception("LogicError") << "Encountered SimHit for TP " << tp.key() << " with DetId " + << detid.rawId() << " whose det() is not Tracker but " << detid.det(); } const auto subdet = detid.subdetId(); - switch(subdet) { - case PixelSubdetector::PixelBarrel: - case PixelSubdetector::PixelEndcap: - ++nPixel; - break; - case StripSubdetector::TIB: - case StripSubdetector::TID: - case StripSubdetector::TOB: - case StripSubdetector::TEC: - ++nStrip; - break; - default: - throw cms::Exception("LogicError") << "Encountered SimHit for TP " << tp.key() << " with DetId " << detid.rawId() << " whose subdet is not recognized, is " << subdet; + switch (subdet) { + case PixelSubdetector::PixelBarrel: + case PixelSubdetector::PixelEndcap: + ++nPixel; + break; + case StripSubdetector::TIB: + case StripSubdetector::TID: + case StripSubdetector::TOB: + case StripSubdetector::TEC: + ++nStrip; + break; + default: + throw cms::Exception("LogicError") << "Encountered SimHit for TP " << tp.key() << " with DetId " + << detid.rawId() << " whose subdet is not recognized, is " << subdet; }; } - sim_nValid .push_back( hitIdx.size() ); - sim_nPixel .push_back( nPixel ); - sim_nStrip .push_back( nStrip ); + sim_nValid.push_back(hitIdx.size()); + sim_nPixel.push_back(nPixel); + sim_nStrip.push_back(nStrip); const auto nSimLayers = nLayers_tPCeff[tp]; const auto nSimPixelLayers = nPixelLayers_tPCeff[tp]; const auto nSimStripMonoAndStereoLayers = nStripMonoAndStereoLayers_tPCeff[tp]; - sim_nLay .push_back( nSimLayers ); - sim_nPixelLay.push_back( nSimPixelLayers ); - sim_n3DLay .push_back( nSimPixelLayers+nSimStripMonoAndStereoLayers ); + sim_nLay.push_back(nSimLayers); + sim_nPixelLay.push_back(nSimPixelLayers); + sim_n3DLay.push_back(nSimPixelLayers + nSimStripMonoAndStereoLayers); sim_nTrackerHits.push_back(tp->numberOfTrackerHits()); auto found = tpKeyToClusterCount.find(tp.key()); @@ -3403,26 +3526,27 @@ void TrackingNtuple::fillTrackingParticlesForSeeds(const TrackingParticleRefVect const reco::SimToRecoCollection& simRecColl, const TrackingParticleRefKeyToIndex& tpKeyToIndex, const unsigned int seedOffset) { - if(sim_seedIdx.empty()) // first call + if (sim_seedIdx.empty()) // first call sim_seedIdx.resize(tpCollection.size()); - for(const auto& keyVal: simRecColl) { + for (const auto& keyVal : simRecColl) { const auto& tpRef = keyVal.key; auto found = tpKeyToIndex.find(tpRef.key()); - if(found == tpKeyToIndex.end()) - throw cms::Exception("Assert") << __FILE__ << ":" << __LINE__ << " fillTrackingParticlesForSeeds: tpRef.key() " << tpRef.key() << " not found from tpKeyToIndex. tpKeyToIndex size " << tpKeyToIndex.size(); + if (found == tpKeyToIndex.end()) + throw cms::Exception("Assert") << __FILE__ << ":" << __LINE__ << " fillTrackingParticlesForSeeds: tpRef.key() " + << tpRef.key() << " not found from tpKeyToIndex. tpKeyToIndex size " + << tpKeyToIndex.size(); const auto tpIndex = found->second; - for(const auto& pair: keyVal.val) { + for (const auto& pair : keyVal.val) { const auto& seedRef = pair.first->seedRef(); sim_seedIdx[tpIndex].push_back(seedOffset + seedRef.key()); } } } - void TrackingNtuple::fillVertices(const reco::VertexCollection& vertices, const edm::RefToBaseVector& tracks) { - for(size_t iVertex=0, size=vertices.size(); iVertex trkIdx; - for(auto iTrack = vertex.tracks_begin(); iTrack != vertex.tracks_end(); ++iTrack) { + for (auto iTrack = vertex.tracks_begin(); iTrack != vertex.tracks_end(); ++iTrack) { // Ignore link if vertex was fit from a track collection different from the input - if(iTrack->id() != tracks.id()) + if (iTrack->id() != tracks.id()) continue; trkIdx.push_back(iTrack->key()); - if(trk_vtxIdx[iTrack->key()] != -1) { - throw cms::Exception("LogicError") << "Vertex index has already been set for track " << iTrack->key() << " to " << trk_vtxIdx[iTrack->key()] << "; was trying to set it to " << iVertex; + if (trk_vtxIdx[iTrack->key()] != -1) { + throw cms::Exception("LogicError") << "Vertex index has already been set for track " << iTrack->key() << " to " + << trk_vtxIdx[iTrack->key()] << "; was trying to set it to " << iVertex; } trk_vtxIdx[iTrack->key()] = iVertex; } @@ -3453,19 +3578,18 @@ void TrackingNtuple::fillVertices(const reco::VertexCollection& vertices, } void TrackingNtuple::fillTrackingVertices(const TrackingVertexRefVector& trackingVertices, - const TrackingParticleRefKeyToIndex& tpKeyToIndex - ) { + const TrackingParticleRefKeyToIndex& tpKeyToIndex) { int current_event = -1; - for(const auto& ref: trackingVertices) { + for (const auto& ref : trackingVertices) { const TrackingVertex v = *ref; - if(v.eventId().event() != current_event) { + if (v.eventId().event() != current_event) { // next PV current_event = v.eventId().event(); simpv_idx.push_back(simvtx_x.size()); } unsigned int processType = std::numeric_limits::max(); - if(!v.g4Vertices().empty()) { + if (!v.g4Vertices().empty()) { processType = v.g4Vertices()[0].processType(); } @@ -3478,9 +3602,9 @@ void TrackingNtuple::fillTrackingVertices(const TrackingVertexRefVector& trackin simvtx_z.push_back(v.position().z()); auto fill = [&](const TrackingParticleRefVector& tps, std::vector& idx) { - for(const auto& tpRef: tps) { + for (const auto& tpRef : tps) { auto found = tpKeyToIndex.find(tpRef.key()); - if(found != tpKeyToIndex.end()) { + if (found != tpKeyToIndex.end()) { idx.push_back(found->second); } } @@ -3501,32 +3625,32 @@ void TrackingNtuple::fillDescriptions(edm::ConfigurationDescriptions& descriptio //The following says we do not know what parameters are allowed so do no validation // Please change this to state exactly what you do use, even if it is no parameters edm::ParameterSetDescription desc; - desc.addUntracked >("seedTracks", std::vector{ - edm::InputTag("seedTracksinitialStepSeeds"), - edm::InputTag("seedTracksdetachedTripletStepSeeds"), - edm::InputTag("seedTrackspixelPairStepSeeds"), - edm::InputTag("seedTrackslowPtTripletStepSeeds"), - edm::InputTag("seedTracksmixedTripletStepSeeds"), - edm::InputTag("seedTrackspixelLessStepSeeds"), - edm::InputTag("seedTrackstobTecStepSeeds"), - edm::InputTag("seedTracksjetCoreRegionalStepSeeds"), - edm::InputTag("seedTracksmuonSeededSeedsInOut"), - edm::InputTag("seedTracksmuonSeededSeedsOutIn") - }); - desc.addUntracked >("trackCandidates", std::vector{ - edm::InputTag("initialStepTrackCandidates"), - edm::InputTag("detachedTripletStepTrackCandidates"), - edm::InputTag("pixelPairStepTrackCandidates"), - edm::InputTag("lowPtTripletStepTrackCandidates"), - edm::InputTag("mixedTripletStepTrackCandidates"), - edm::InputTag("pixelLessStepTrackCandidates"), - edm::InputTag("tobTecStepTrackCandidates"), - edm::InputTag("jetCoreRegionalStepTrackCandidates"), - edm::InputTag("muonSeededTrackCandidatesInOut"), - edm::InputTag("muonSeededTrackCandidatesOutIn") - }); + desc.addUntracked>( + "seedTracks", + std::vector{edm::InputTag("seedTracksinitialStepSeeds"), + edm::InputTag("seedTracksdetachedTripletStepSeeds"), + edm::InputTag("seedTrackspixelPairStepSeeds"), + edm::InputTag("seedTrackslowPtTripletStepSeeds"), + edm::InputTag("seedTracksmixedTripletStepSeeds"), + edm::InputTag("seedTrackspixelLessStepSeeds"), + edm::InputTag("seedTrackstobTecStepSeeds"), + edm::InputTag("seedTracksjetCoreRegionalStepSeeds"), + edm::InputTag("seedTracksmuonSeededSeedsInOut"), + edm::InputTag("seedTracksmuonSeededSeedsOutIn")}); + desc.addUntracked>( + "trackCandidates", + std::vector{edm::InputTag("initialStepTrackCandidates"), + edm::InputTag("detachedTripletStepTrackCandidates"), + edm::InputTag("pixelPairStepTrackCandidates"), + edm::InputTag("lowPtTripletStepTrackCandidates"), + edm::InputTag("mixedTripletStepTrackCandidates"), + edm::InputTag("pixelLessStepTrackCandidates"), + edm::InputTag("tobTecStepTrackCandidates"), + edm::InputTag("jetCoreRegionalStepTrackCandidates"), + edm::InputTag("muonSeededTrackCandidatesInOut"), + edm::InputTag("muonSeededTrackCandidatesOutIn")}); desc.addUntracked("tracks", edm::InputTag("generalTracks")); - desc.addUntracked >("trackMVAs", std::vector{{"generalTracks"}}); + desc.addUntracked>("trackMVAs", std::vector{{"generalTracks"}}); desc.addUntracked("trackingParticles", edm::InputTag("mix", "MergedTrackTruth")); desc.addUntracked("trackingParticlesRef", false); desc.addUntracked("clusterTPMap", edm::InputTag("tpClusterProducer")); @@ -3543,16 +3667,19 @@ void TrackingNtuple::fillDescriptions(edm::ConfigurationDescriptions& descriptio desc.addUntracked("phase2OTRecHits", edm::InputTag("siPhase2RecHits")); desc.addUntracked("vertices", edm::InputTag("offlinePrimaryVertices")); desc.addUntracked("trackingVertices", edm::InputTag("mix", "MergedTrackTruth")); - desc.addUntracked("trackingParticleNlayers", edm::InputTag("trackingParticleNumberOfLayersProducer", "trackerLayers")); - desc.addUntracked("trackingParticleNpixellayers", edm::InputTag("trackingParticleNumberOfLayersProducer", "pixelLayers")); - desc.addUntracked("trackingParticleNstripstereolayers", edm::InputTag("trackingParticleNumberOfLayersProducer", "stripStereoLayers")); + desc.addUntracked("trackingParticleNlayers", + edm::InputTag("trackingParticleNumberOfLayersProducer", "trackerLayers")); + desc.addUntracked("trackingParticleNpixellayers", + edm::InputTag("trackingParticleNumberOfLayersProducer", "pixelLayers")); + desc.addUntracked("trackingParticleNstripstereolayers", + edm::InputTag("trackingParticleNumberOfLayersProducer", "stripStereoLayers")); desc.addUntracked("TTRHBuilder", "WithTrackAngle"); desc.addUntracked("parametersDefiner", "LhcParametersDefinerForTP"); desc.addUntracked("includeSeeds", false); desc.addUntracked("includeAllHits", false); desc.addUntracked("includeMVA", true); desc.addUntracked("includeTrackingParticles", true); - descriptions.add("trackingNtuple",desc); + descriptions.add("trackingNtuple", desc); } //define this as a plug-in diff --git a/Validation/RecoTrack/src/SiStripTrackingRecHitsValid.cc b/Validation/RecoTrack/src/SiStripTrackingRecHitsValid.cc index 65b4e197de558..14e43be55367a 100644 --- a/Validation/RecoTrack/src/SiStripTrackingRecHitsValid.cc +++ b/Validation/RecoTrack/src/SiStripTrackingRecHitsValid.cc @@ -41,12 +41,12 @@ using namespace edm; class TFile; //Constructor -SiStripTrackingRecHitsValid::SiStripTrackingRecHitsValid(const edm::ParameterSet& ps) : - dbe_(edm::Service().operator->()), - conf_(ps), - trackerHitAssociatorConfig_(ps, consumesCollector()), - m_cacheID_(0) - // trajectoryInput_( ps.getParameter("trajectoryInput") ) +SiStripTrackingRecHitsValid::SiStripTrackingRecHitsValid(const edm::ParameterSet &ps) + : dbe_(edm::Service().operator->()), + conf_(ps), + trackerHitAssociatorConfig_(ps, consumesCollector()), + m_cacheID_(0) +// trajectoryInput_( ps.getParameter("trajectoryInput") ) { topFolderName_ = conf_.getParameter("TopFolderName"); @@ -55,408 +55,509 @@ SiStripTrackingRecHitsValid::SiStripTrackingRecHitsValid(const edm::ParameterSet outputMEsInRootFile = conf_.getParameter("OutputMEsInRootFile"); outputFileName = conf_.getParameter("outputFile"); - - tracksInputToken_ = consumes >( conf_.getParameter("tracksInput") ); - edm::ParameterSet ParametersResolx_LF = conf_.getParameter("TH1Resolx_LF"); + tracksInputToken_ = consumes >(conf_.getParameter("tracksInput")); + + edm::ParameterSet ParametersResolx_LF = conf_.getParameter("TH1Resolx_LF"); layerswitchResolx_LF = ParametersResolx_LF.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolx_MF = conf_.getParameter("TH1Resolx_MF"); + edm::ParameterSet ParametersResolx_MF = conf_.getParameter("TH1Resolx_MF"); layerswitchResolx_MF = ParametersResolx_MF.getParameter("layerswitchon"); - edm::ParameterSet ParametersRes_LF = conf_.getParameter("TH1Res_LF"); + edm::ParameterSet ParametersRes_LF = conf_.getParameter("TH1Res_LF"); layerswitchRes_LF = ParametersRes_LF.getParameter("layerswitchon"); - edm::ParameterSet ParametersRes_MF = conf_.getParameter("TH1Res_MF"); + edm::ParameterSet ParametersRes_MF = conf_.getParameter("TH1Res_MF"); layerswitchRes_MF = ParametersRes_MF.getParameter("layerswitchon"); - edm::ParameterSet ParametersPull_LF = conf_.getParameter("TH1Pull_LF"); + edm::ParameterSet ParametersPull_LF = conf_.getParameter("TH1Pull_LF"); layerswitchPull_LF = ParametersPull_LF.getParameter("layerswitchon"); - edm::ParameterSet ParametersPull_MF = conf_.getParameter("TH1Pull_MF"); + edm::ParameterSet ParametersPull_MF = conf_.getParameter("TH1Pull_MF"); layerswitchPull_MF = ParametersPull_MF.getParameter("layerswitchon"); - edm::ParameterSet ParametersCategory = conf_.getParameter("TH1Category"); + edm::ParameterSet ParametersCategory = conf_.getParameter("TH1Category"); layerswitchCategory = ParametersCategory.getParameter("layerswitchon"); - edm::ParameterSet ParametersTrackwidth = conf_.getParameter("TH1Trackwidth"); + edm::ParameterSet ParametersTrackwidth = conf_.getParameter("TH1Trackwidth"); layerswitchTrackwidth = ParametersTrackwidth.getParameter("layerswitchon"); - edm::ParameterSet ParametersExpectedwidth = conf_.getParameter("TH1Expectedwidth"); + edm::ParameterSet ParametersExpectedwidth = conf_.getParameter("TH1Expectedwidth"); layerswitchExpectedwidth = ParametersExpectedwidth.getParameter("layerswitchon"); - edm::ParameterSet ParametersClusterwidth = conf_.getParameter("TH1Clusterwidth"); + edm::ParameterSet ParametersClusterwidth = conf_.getParameter("TH1Clusterwidth"); layerswitchClusterwidth = ParametersClusterwidth.getParameter("layerswitchon"); - edm::ParameterSet ParametersTrackanglealpha = conf_.getParameter("TH1Trackanglealpha"); + edm::ParameterSet ParametersTrackanglealpha = conf_.getParameter("TH1Trackanglealpha"); layerswitchTrackanglealpha = ParametersTrackanglealpha.getParameter("layerswitchon"); - edm::ParameterSet ParametersTrackanglebeta = conf_.getParameter("TH1Trackanglebeta"); + edm::ParameterSet ParametersTrackanglebeta = conf_.getParameter("TH1Trackanglebeta"); layerswitchTrackanglebeta = ParametersTrackanglebeta.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFTrackwidthProfile_WClus1 = conf_.getParameter("TProfResolxMFTrackwidthProfile_WClus1"); - layerswitchResolxMFTrackwidthProfile_WClus1 = ParametersResolxMFTrackwidthProfile_WClus1.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfile_WClus2 = conf_.getParameter("TProfResolxMFTrackwidthProfile_WClus2"); - layerswitchResolxMFTrackwidthProfile_WClus2 = ParametersResolxMFTrackwidthProfile_WClus2.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfile_WClus3 = conf_.getParameter("TProfResolxMFTrackwidthProfile_WClus3"); - layerswitchResolxMFTrackwidthProfile_WClus3 = ParametersResolxMFTrackwidthProfile_WClus3.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfile_WClus4 = conf_.getParameter("TProfResolxMFTrackwidthProfile_WClus4"); - layerswitchResolxMFTrackwidthProfile_WClus4 = ParametersResolxMFTrackwidthProfile_WClus4.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResMFTrackwidthProfile_WClus1 = conf_.getParameter("TProfResMFTrackwidthProfile_WClus1"); - layerswitchResMFTrackwidthProfile_WClus1 = ParametersResMFTrackwidthProfile_WClus1.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResMFTrackwidthProfile_WClus2 = conf_.getParameter("TProfResMFTrackwidthProfile_WClus2"); - layerswitchResMFTrackwidthProfile_WClus2 = ParametersResMFTrackwidthProfile_WClus2.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResMFTrackwidthProfile_WClus21 = conf_.getParameter("TProfResMFTrackwidthProfile_WClus21"); - layerswitchResMFTrackwidthProfile_WClus21 = ParametersResMFTrackwidthProfile_WClus21.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResMFTrackwidthProfile_WClus22 = conf_.getParameter("TProfResMFTrackwidthProfile_WClus22"); - layerswitchResMFTrackwidthProfile_WClus22 = ParametersResMFTrackwidthProfile_WClus22.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResMFTrackwidthProfile_WClus23 = conf_.getParameter("TProfResMFTrackwidthProfile_WClus23"); - layerswitchResMFTrackwidthProfile_WClus23 = ParametersResMFTrackwidthProfile_WClus23.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResMFTrackwidthProfile_WClus3 = conf_.getParameter("TProfResMFTrackwidthProfile_WClus3"); - layerswitchResMFTrackwidthProfile_WClus3 = ParametersResMFTrackwidthProfile_WClus3.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResMFTrackwidthProfile_WClus4 = conf_.getParameter("TProfResMFTrackwidthProfile_WClus4"); - layerswitchResMFTrackwidthProfile_WClus4 = ParametersResMFTrackwidthProfile_WClus4.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfile = conf_.getParameter("TProfResolxMFTrackwidthProfile"); + edm::ParameterSet ParametersResolxMFTrackwidthProfile_WClus1 = + conf_.getParameter("TProfResolxMFTrackwidthProfile_WClus1"); + layerswitchResolxMFTrackwidthProfile_WClus1 = + ParametersResolxMFTrackwidthProfile_WClus1.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfile_WClus2 = + conf_.getParameter("TProfResolxMFTrackwidthProfile_WClus2"); + layerswitchResolxMFTrackwidthProfile_WClus2 = + ParametersResolxMFTrackwidthProfile_WClus2.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfile_WClus3 = + conf_.getParameter("TProfResolxMFTrackwidthProfile_WClus3"); + layerswitchResolxMFTrackwidthProfile_WClus3 = + ParametersResolxMFTrackwidthProfile_WClus3.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfile_WClus4 = + conf_.getParameter("TProfResolxMFTrackwidthProfile_WClus4"); + layerswitchResolxMFTrackwidthProfile_WClus4 = + ParametersResolxMFTrackwidthProfile_WClus4.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResMFTrackwidthProfile_WClus1 = + conf_.getParameter("TProfResMFTrackwidthProfile_WClus1"); + layerswitchResMFTrackwidthProfile_WClus1 = + ParametersResMFTrackwidthProfile_WClus1.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResMFTrackwidthProfile_WClus2 = + conf_.getParameter("TProfResMFTrackwidthProfile_WClus2"); + layerswitchResMFTrackwidthProfile_WClus2 = + ParametersResMFTrackwidthProfile_WClus2.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResMFTrackwidthProfile_WClus21 = + conf_.getParameter("TProfResMFTrackwidthProfile_WClus21"); + layerswitchResMFTrackwidthProfile_WClus21 = + ParametersResMFTrackwidthProfile_WClus21.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResMFTrackwidthProfile_WClus22 = + conf_.getParameter("TProfResMFTrackwidthProfile_WClus22"); + layerswitchResMFTrackwidthProfile_WClus22 = + ParametersResMFTrackwidthProfile_WClus22.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResMFTrackwidthProfile_WClus23 = + conf_.getParameter("TProfResMFTrackwidthProfile_WClus23"); + layerswitchResMFTrackwidthProfile_WClus23 = + ParametersResMFTrackwidthProfile_WClus23.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResMFTrackwidthProfile_WClus3 = + conf_.getParameter("TProfResMFTrackwidthProfile_WClus3"); + layerswitchResMFTrackwidthProfile_WClus3 = + ParametersResMFTrackwidthProfile_WClus3.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResMFTrackwidthProfile_WClus4 = + conf_.getParameter("TProfResMFTrackwidthProfile_WClus4"); + layerswitchResMFTrackwidthProfile_WClus4 = + ParametersResMFTrackwidthProfile_WClus4.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfile = + conf_.getParameter("TProfResolxMFTrackwidthProfile"); layerswitchResolxMFTrackwidthProfile = ParametersResolxMFTrackwidthProfile.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFTrackwidthProfile_Category1 = conf_.getParameter("TProfResolxMFTrackwidthProfile_Category1"); - layerswitchResolxMFTrackwidthProfile_Category1 = ParametersResolxMFTrackwidthProfile_Category1.getParameter("layerswitchon"); + edm::ParameterSet ParametersResolxMFTrackwidthProfile_Category1 = + conf_.getParameter("TProfResolxMFTrackwidthProfile_Category1"); + layerswitchResolxMFTrackwidthProfile_Category1 = + ParametersResolxMFTrackwidthProfile_Category1.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFTrackwidthProfile_Category2 = conf_.getParameter("TProfResolxMFTrackwidthProfile_Category2"); - layerswitchResolxMFTrackwidthProfile_Category2 = ParametersResolxMFTrackwidthProfile_Category2.getParameter("layerswitchon"); + edm::ParameterSet ParametersResolxMFTrackwidthProfile_Category2 = + conf_.getParameter("TProfResolxMFTrackwidthProfile_Category2"); + layerswitchResolxMFTrackwidthProfile_Category2 = + ParametersResolxMFTrackwidthProfile_Category2.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFTrackwidthProfile_Category3 = conf_.getParameter("TProfResolxMFTrackwidthProfile_Category3"); - layerswitchResolxMFTrackwidthProfile_Category3 = ParametersResolxMFTrackwidthProfile_Category3.getParameter("layerswitchon"); + edm::ParameterSet ParametersResolxMFTrackwidthProfile_Category3 = + conf_.getParameter("TProfResolxMFTrackwidthProfile_Category3"); + layerswitchResolxMFTrackwidthProfile_Category3 = + ParametersResolxMFTrackwidthProfile_Category3.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFTrackwidthProfile_Category4 = conf_.getParameter("TProfResolxMFTrackwidthProfile_Category4"); - layerswitchResolxMFTrackwidthProfile_Category4 = ParametersResolxMFTrackwidthProfile_Category4.getParameter("layerswitchon"); + edm::ParameterSet ParametersResolxMFTrackwidthProfile_Category4 = + conf_.getParameter("TProfResolxMFTrackwidthProfile_Category4"); + layerswitchResolxMFTrackwidthProfile_Category4 = + ParametersResolxMFTrackwidthProfile_Category4.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFClusterwidthProfile_Category1 = conf_.getParameter("TProfResolxMFClusterwidthProfile_Category1"); - layerswitchResolxMFClusterwidthProfile_Category1 = ParametersResolxMFClusterwidthProfile_Category1.getParameter("layerswitchon"); + edm::ParameterSet ParametersResolxMFClusterwidthProfile_Category1 = + conf_.getParameter("TProfResolxMFClusterwidthProfile_Category1"); + layerswitchResolxMFClusterwidthProfile_Category1 = + ParametersResolxMFClusterwidthProfile_Category1.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFAngleProfile = conf_.getParameter("TProfResolxMFAngleProfile"); + edm::ParameterSet ParametersResolxMFAngleProfile = conf_.getParameter("TProfResolxMFAngleProfile"); layerswitchResolxMFAngleProfile = ParametersResolxMFAngleProfile.getParameter("layerswitchon"); - - edm::ParameterSet ParametersWclusRphi = conf_.getParameter("TH1WclusRphi"); + + edm::ParameterSet ParametersWclusRphi = conf_.getParameter("TH1WclusRphi"); layerswitchWclusRphi = ParametersWclusRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersAdcRphi = conf_.getParameter("TH1AdcRphi"); + edm::ParameterSet ParametersAdcRphi = conf_.getParameter("TH1AdcRphi"); layerswitchAdcRphi = ParametersAdcRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxLFRphi = conf_.getParameter("TH1ResolxLFRphi"); + edm::ParameterSet ParametersResolxLFRphi = conf_.getParameter("TH1ResolxLFRphi"); layerswitchResolxLFRphi = ParametersResolxLFRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFRphi = conf_.getParameter("TH1ResolxMFRphi"); + edm::ParameterSet ParametersResolxMFRphi = conf_.getParameter("TH1ResolxMFRphi"); layerswitchResolxMFRphi = ParametersResolxMFRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFRphiwclus1 = conf_.getParameter("TH1ResolxMFRphiwclus1"); + edm::ParameterSet ParametersResolxMFRphiwclus1 = conf_.getParameter("TH1ResolxMFRphiwclus1"); layerswitchResolxMFRphiwclus1 = ParametersResolxMFRphiwclus1.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFRphiwclus2 = conf_.getParameter("TH1ResolxMFRphiwclus2"); + edm::ParameterSet ParametersResolxMFRphiwclus2 = conf_.getParameter("TH1ResolxMFRphiwclus2"); layerswitchResolxMFRphiwclus2 = ParametersResolxMFRphiwclus2.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFRphiwclus3 = conf_.getParameter("TH1ResolxMFRphiwclus3"); + edm::ParameterSet ParametersResolxMFRphiwclus3 = conf_.getParameter("TH1ResolxMFRphiwclus3"); layerswitchResolxMFRphiwclus3 = ParametersResolxMFRphiwclus3.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFRphiwclus4 = conf_.getParameter("TH1ResolxMFRphiwclus4"); + edm::ParameterSet ParametersResolxMFRphiwclus4 = conf_.getParameter("TH1ResolxMFRphiwclus4"); layerswitchResolxMFRphiwclus4 = ParametersResolxMFRphiwclus4.getParameter("layerswitchon"); - edm::ParameterSet ParametersResLFRphi = conf_.getParameter("TH1ResLFRphi"); + edm::ParameterSet ParametersResLFRphi = conf_.getParameter("TH1ResLFRphi"); layerswitchResLFRphi = ParametersResLFRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersResMFRphi = conf_.getParameter("TH1ResMFRphi"); + edm::ParameterSet ParametersResMFRphi = conf_.getParameter("TH1ResMFRphi"); layerswitchResMFRphi = ParametersResMFRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersResMFRphiwclus1 = conf_.getParameter("TH1ResMFRphiwclus1"); + edm::ParameterSet ParametersResMFRphiwclus1 = conf_.getParameter("TH1ResMFRphiwclus1"); layerswitchResMFRphiwclus1 = ParametersResMFRphiwclus1.getParameter("layerswitchon"); - edm::ParameterSet ParametersResMFRphiwclus2 = conf_.getParameter("TH1ResMFRphiwclus2"); + edm::ParameterSet ParametersResMFRphiwclus2 = conf_.getParameter("TH1ResMFRphiwclus2"); layerswitchResMFRphiwclus2 = ParametersResMFRphiwclus2.getParameter("layerswitchon"); - edm::ParameterSet ParametersResMFRphiwclus3 = conf_.getParameter("TH1ResMFRphiwclus3"); + edm::ParameterSet ParametersResMFRphiwclus3 = conf_.getParameter("TH1ResMFRphiwclus3"); layerswitchResMFRphiwclus3 = ParametersResMFRphiwclus3.getParameter("layerswitchon"); - edm::ParameterSet ParametersResMFRphiwclus4 = conf_.getParameter("TH1ResMFRphiwclus4"); + edm::ParameterSet ParametersResMFRphiwclus4 = conf_.getParameter("TH1ResMFRphiwclus4"); layerswitchResMFRphiwclus4 = ParametersResMFRphiwclus4.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullLFRphi = conf_.getParameter("TH1PullLFRphi"); + edm::ParameterSet ParametersPullLFRphi = conf_.getParameter("TH1PullLFRphi"); layerswitchPullLFRphi = ParametersPullLFRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullMFRphi = conf_.getParameter("TH1PullMFRphi"); + edm::ParameterSet ParametersPullMFRphi = conf_.getParameter("TH1PullMFRphi"); layerswitchPullMFRphi = ParametersPullMFRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullMFRphiwclus1 = conf_.getParameter("TH1PullMFRphiwclus1"); + edm::ParameterSet ParametersPullMFRphiwclus1 = conf_.getParameter("TH1PullMFRphiwclus1"); layerswitchPullMFRphiwclus1 = ParametersPullMFRphiwclus1.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullMFRphiwclus2 = conf_.getParameter("TH1PullMFRphiwclus2"); + edm::ParameterSet ParametersPullMFRphiwclus2 = conf_.getParameter("TH1PullMFRphiwclus2"); layerswitchPullMFRphiwclus2 = ParametersPullMFRphiwclus2.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullMFRphiwclus3 = conf_.getParameter("TH1PullMFRphiwclus3"); + edm::ParameterSet ParametersPullMFRphiwclus3 = conf_.getParameter("TH1PullMFRphiwclus3"); layerswitchPullMFRphiwclus3 = ParametersPullMFRphiwclus3.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullMFRphiwclus4 = conf_.getParameter("TH1PullMFRphiwclus4"); + edm::ParameterSet ParametersPullMFRphiwclus4 = conf_.getParameter("TH1PullMFRphiwclus4"); layerswitchPullMFRphiwclus4 = ParametersPullMFRphiwclus4.getParameter("layerswitchon"); - edm::ParameterSet ParametersTrackangleRphi = conf_.getParameter("TH1TrackangleRphi"); + edm::ParameterSet ParametersTrackangleRphi = conf_.getParameter("TH1TrackangleRphi"); layerswitchTrackangleRphi = ParametersTrackangleRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersTrackanglebetaRphi = conf_.getParameter("TH1TrackanglebetaRphi"); + edm::ParameterSet ParametersTrackanglebetaRphi = conf_.getParameter("TH1TrackanglebetaRphi"); layerswitchTrackanglebetaRphi = ParametersTrackanglebetaRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersTrackangle2Rphi = conf_.getParameter("TH1Trackangle2Rphi"); + edm::ParameterSet ParametersTrackangle2Rphi = conf_.getParameter("TH1Trackangle2Rphi"); layerswitchTrackangle2Rphi = ParametersTrackangle2Rphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullTrackangleProfileRphi = conf_.getParameter("TProfPullTrackangleProfileRphi"); + edm::ParameterSet ParametersPullTrackangleProfileRphi = + conf_.getParameter("TProfPullTrackangleProfileRphi"); layerswitchPullTrackangleProfileRphi = ParametersPullTrackangleProfileRphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersPullTrackangle2DRphi = conf_.getParameter("TH1PullTrackangle2DRphi"); + + edm::ParameterSet ParametersPullTrackangle2DRphi = conf_.getParameter("TH1PullTrackangle2DRphi"); layerswitchPullTrackangle2DRphi = ParametersPullTrackangle2DRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersTrackwidthRphi = conf_.getParameter("TH1TrackwidthRphi"); + edm::ParameterSet ParametersTrackwidthRphi = conf_.getParameter("TH1TrackwidthRphi"); layerswitchTrackwidthRphi = ParametersTrackwidthRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersExpectedwidthRphi = conf_.getParameter("TH1ExpectedwidthRphi"); + edm::ParameterSet ParametersExpectedwidthRphi = conf_.getParameter("TH1ExpectedwidthRphi"); layerswitchExpectedwidthRphi = ParametersExpectedwidthRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersClusterwidthRphi = conf_.getParameter("TH1ClusterwidthRphi"); + edm::ParameterSet ParametersClusterwidthRphi = conf_.getParameter("TH1ClusterwidthRphi"); layerswitchClusterwidthRphi = ParametersClusterwidthRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersCategoryRphi = conf_.getParameter("TH1CategoryRphi"); + edm::ParameterSet ParametersCategoryRphi = conf_.getParameter("TH1CategoryRphi"); layerswitchCategoryRphi = ParametersCategoryRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullTrackwidthProfileRphi = conf_.getParameter("TProfPullTrackwidthProfileRphi"); + edm::ParameterSet ParametersPullTrackwidthProfileRphi = + conf_.getParameter("TProfPullTrackwidthProfileRphi"); layerswitchPullTrackwidthProfileRphi = ParametersPullTrackwidthProfileRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullTrackwidthProfileRphiwclus1 = conf_.getParameter("TProfPullTrackwidthProfileRphiwclus1"); - layerswitchPullTrackwidthProfileRphiwclus1 = ParametersPullTrackwidthProfileRphiwclus1.getParameter("layerswitchon"); - - edm::ParameterSet ParametersPullTrackwidthProfileRphiwclus2 = conf_.getParameter("TProfPullTrackwidthProfileRphiwclus2"); - layerswitchPullTrackwidthProfileRphiwclus2 = ParametersPullTrackwidthProfileRphiwclus2.getParameter("layerswitchon"); - - edm::ParameterSet ParametersPullTrackwidthProfileRphiwclus3 = conf_.getParameter("TProfPullTrackwidthProfileRphiwclus3"); - layerswitchPullTrackwidthProfileRphiwclus3 = ParametersPullTrackwidthProfileRphiwclus3.getParameter("layerswitchon"); - - edm::ParameterSet ParametersPullTrackwidthProfileRphiwclus4 = conf_.getParameter("TProfPullTrackwidthProfileRphiwclus4"); - layerswitchPullTrackwidthProfileRphiwclus4 = ParametersPullTrackwidthProfileRphiwclus4.getParameter("layerswitchon"); - - edm::ParameterSet ParametersPullTrackwidthProfileCategory1Rphi = conf_.getParameter("TProfPullTrackwidthProfileCategory1Rphi"); - layerswitchPullTrackwidthProfileCategory1Rphi = ParametersPullTrackwidthProfileCategory1Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersPullTrackwidthProfileCategory2Rphi = conf_.getParameter("TProfPullTrackwidthProfileCategory2Rphi"); - layerswitchPullTrackwidthProfileCategory2Rphi = ParametersPullTrackwidthProfileCategory2Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersPullTrackwidthProfileCategory3Rphi = conf_.getParameter("TProfPullTrackwidthProfileCategory3Rphi"); - layerswitchPullTrackwidthProfileCategory3Rphi = ParametersPullTrackwidthProfileCategory3Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersPullTrackwidthProfileCategory4Rphi = conf_.getParameter("TProfPullTrackwidthProfileCategory4Rphi"); - layerswitchPullTrackwidthProfileCategory4Rphi = ParametersPullTrackwidthProfileCategory4Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfileRphi = conf_.getParameter("TProfResolxMFTrackwidthProfileRphi"); - layerswitchResolxMFTrackwidthProfileRphi = ParametersResolxMFTrackwidthProfileRphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfileWclus1Rphi = conf_.getParameter("TProfResolxMFTrackwidthProfileWclus1Rphi"); - layerswitchResolxMFTrackwidthProfileWclus1Rphi = ParametersResolxMFTrackwidthProfileWclus1Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfileWclus2Rphi = conf_.getParameter("TProfResolxMFTrackwidthProfileWclus2Rphi"); - layerswitchResolxMFTrackwidthProfileWclus2Rphi = ParametersResolxMFTrackwidthProfileWclus2Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfileWclus3Rphi = conf_.getParameter("TProfResolxMFTrackwidthProfileWclus3Rphi"); - layerswitchResolxMFTrackwidthProfileWclus3Rphi = ParametersResolxMFTrackwidthProfileWclus3Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfileWclus4Rphi = conf_.getParameter("TProfResolxMFTrackwidthProfileWclus4Rphi"); - layerswitchResolxMFTrackwidthProfileWclus4Rphi = ParametersResolxMFTrackwidthProfileWclus4Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResMFTrackwidthProfileWclus1Rphi = conf_.getParameter("TProfResMFTrackwidthProfileWclus1Rphi"); - layerswitchResMFTrackwidthProfileWclus1Rphi = ParametersResMFTrackwidthProfileWclus1Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResMFTrackwidthProfileWclus2Rphi = conf_.getParameter("TProfResMFTrackwidthProfileWclus2Rphi"); - layerswitchResMFTrackwidthProfileWclus2Rphi = ParametersResMFTrackwidthProfileWclus2Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResMFTrackwidthProfileWclus3Rphi = conf_.getParameter("TProfResMFTrackwidthProfileWclus3Rphi"); - layerswitchResMFTrackwidthProfileWclus3Rphi = ParametersResMFTrackwidthProfileWclus3Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResMFTrackwidthProfileWclus4Rphi = conf_.getParameter("TProfResMFTrackwidthProfileWclus4Rphi"); - layerswitchResMFTrackwidthProfileWclus4Rphi = ParametersResMFTrackwidthProfileWclus4Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory1Rphi = conf_.getParameter("TProfResolxMFTrackwidthProfileCategory1Rphi"); - layerswitchResolxMFTrackwidthProfileCategory1Rphi = ParametersResolxMFTrackwidthProfileCategory1Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory2Rphi = conf_.getParameter("TProfResolxMFTrackwidthProfileCategory2Rphi"); - layerswitchResolxMFTrackwidthProfileCategory2Rphi = ParametersResolxMFTrackwidthProfileCategory2Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory3Rphi = conf_.getParameter("TProfResolxMFTrackwidthProfileCategory3Rphi"); - layerswitchResolxMFTrackwidthProfileCategory3Rphi = ParametersResolxMFTrackwidthProfileCategory3Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory4Rphi = conf_.getParameter("TProfResolxMFTrackwidthProfileCategory4Rphi"); - layerswitchResolxMFTrackwidthProfileCategory4Rphi = ParametersResolxMFTrackwidthProfileCategory4Rphi.getParameter("layerswitchon"); - - edm::ParameterSet ParametersResolxMFAngleProfileRphi = conf_.getParameter("TProfResolxMFAngleProfileRphi"); + edm::ParameterSet ParametersPullTrackwidthProfileRphiwclus1 = + conf_.getParameter("TProfPullTrackwidthProfileRphiwclus1"); + layerswitchPullTrackwidthProfileRphiwclus1 = + ParametersPullTrackwidthProfileRphiwclus1.getParameter("layerswitchon"); + + edm::ParameterSet ParametersPullTrackwidthProfileRphiwclus2 = + conf_.getParameter("TProfPullTrackwidthProfileRphiwclus2"); + layerswitchPullTrackwidthProfileRphiwclus2 = + ParametersPullTrackwidthProfileRphiwclus2.getParameter("layerswitchon"); + + edm::ParameterSet ParametersPullTrackwidthProfileRphiwclus3 = + conf_.getParameter("TProfPullTrackwidthProfileRphiwclus3"); + layerswitchPullTrackwidthProfileRphiwclus3 = + ParametersPullTrackwidthProfileRphiwclus3.getParameter("layerswitchon"); + + edm::ParameterSet ParametersPullTrackwidthProfileRphiwclus4 = + conf_.getParameter("TProfPullTrackwidthProfileRphiwclus4"); + layerswitchPullTrackwidthProfileRphiwclus4 = + ParametersPullTrackwidthProfileRphiwclus4.getParameter("layerswitchon"); + + edm::ParameterSet ParametersPullTrackwidthProfileCategory1Rphi = + conf_.getParameter("TProfPullTrackwidthProfileCategory1Rphi"); + layerswitchPullTrackwidthProfileCategory1Rphi = + ParametersPullTrackwidthProfileCategory1Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersPullTrackwidthProfileCategory2Rphi = + conf_.getParameter("TProfPullTrackwidthProfileCategory2Rphi"); + layerswitchPullTrackwidthProfileCategory2Rphi = + ParametersPullTrackwidthProfileCategory2Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersPullTrackwidthProfileCategory3Rphi = + conf_.getParameter("TProfPullTrackwidthProfileCategory3Rphi"); + layerswitchPullTrackwidthProfileCategory3Rphi = + ParametersPullTrackwidthProfileCategory3Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersPullTrackwidthProfileCategory4Rphi = + conf_.getParameter("TProfPullTrackwidthProfileCategory4Rphi"); + layerswitchPullTrackwidthProfileCategory4Rphi = + ParametersPullTrackwidthProfileCategory4Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfileRphi = + conf_.getParameter("TProfResolxMFTrackwidthProfileRphi"); + layerswitchResolxMFTrackwidthProfileRphi = + ParametersResolxMFTrackwidthProfileRphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfileWclus1Rphi = + conf_.getParameter("TProfResolxMFTrackwidthProfileWclus1Rphi"); + layerswitchResolxMFTrackwidthProfileWclus1Rphi = + ParametersResolxMFTrackwidthProfileWclus1Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfileWclus2Rphi = + conf_.getParameter("TProfResolxMFTrackwidthProfileWclus2Rphi"); + layerswitchResolxMFTrackwidthProfileWclus2Rphi = + ParametersResolxMFTrackwidthProfileWclus2Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfileWclus3Rphi = + conf_.getParameter("TProfResolxMFTrackwidthProfileWclus3Rphi"); + layerswitchResolxMFTrackwidthProfileWclus3Rphi = + ParametersResolxMFTrackwidthProfileWclus3Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfileWclus4Rphi = + conf_.getParameter("TProfResolxMFTrackwidthProfileWclus4Rphi"); + layerswitchResolxMFTrackwidthProfileWclus4Rphi = + ParametersResolxMFTrackwidthProfileWclus4Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResMFTrackwidthProfileWclus1Rphi = + conf_.getParameter("TProfResMFTrackwidthProfileWclus1Rphi"); + layerswitchResMFTrackwidthProfileWclus1Rphi = + ParametersResMFTrackwidthProfileWclus1Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResMFTrackwidthProfileWclus2Rphi = + conf_.getParameter("TProfResMFTrackwidthProfileWclus2Rphi"); + layerswitchResMFTrackwidthProfileWclus2Rphi = + ParametersResMFTrackwidthProfileWclus2Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResMFTrackwidthProfileWclus3Rphi = + conf_.getParameter("TProfResMFTrackwidthProfileWclus3Rphi"); + layerswitchResMFTrackwidthProfileWclus3Rphi = + ParametersResMFTrackwidthProfileWclus3Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResMFTrackwidthProfileWclus4Rphi = + conf_.getParameter("TProfResMFTrackwidthProfileWclus4Rphi"); + layerswitchResMFTrackwidthProfileWclus4Rphi = + ParametersResMFTrackwidthProfileWclus4Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory1Rphi = + conf_.getParameter("TProfResolxMFTrackwidthProfileCategory1Rphi"); + layerswitchResolxMFTrackwidthProfileCategory1Rphi = + ParametersResolxMFTrackwidthProfileCategory1Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory2Rphi = + conf_.getParameter("TProfResolxMFTrackwidthProfileCategory2Rphi"); + layerswitchResolxMFTrackwidthProfileCategory2Rphi = + ParametersResolxMFTrackwidthProfileCategory2Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory3Rphi = + conf_.getParameter("TProfResolxMFTrackwidthProfileCategory3Rphi"); + layerswitchResolxMFTrackwidthProfileCategory3Rphi = + ParametersResolxMFTrackwidthProfileCategory3Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory4Rphi = + conf_.getParameter("TProfResolxMFTrackwidthProfileCategory4Rphi"); + layerswitchResolxMFTrackwidthProfileCategory4Rphi = + ParametersResolxMFTrackwidthProfileCategory4Rphi.getParameter("layerswitchon"); + + edm::ParameterSet ParametersResolxMFAngleProfileRphi = + conf_.getParameter("TProfResolxMFAngleProfileRphi"); layerswitchResolxMFAngleProfileRphi = ParametersResolxMFAngleProfileRphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFClusterwidthProfileCategory1Rphi = conf_.getParameter("TProfResolxMFClusterwidthProfileCategory1Rphi"); - layerswitchResolxMFClusterwidthProfileCategory1Rphi = ParametersResolxMFClusterwidthProfileCategory1Rphi.getParameter("layerswitchon"); + edm::ParameterSet ParametersResolxMFClusterwidthProfileCategory1Rphi = + conf_.getParameter("TProfResolxMFClusterwidthProfileCategory1Rphi"); + layerswitchResolxMFClusterwidthProfileCategory1Rphi = + ParametersResolxMFClusterwidthProfileCategory1Rphi.getParameter("layerswitchon"); - edm::ParameterSet ParametersrapidityResProfilewclus1 = conf_.getParameter("TProfrapidityResProfilewclus1"); + edm::ParameterSet ParametersrapidityResProfilewclus1 = + conf_.getParameter("TProfrapidityResProfilewclus1"); layerswitchrapidityResProfilewclus1 = ParametersrapidityResProfilewclus1.getParameter("layerswitchon"); - edm::ParameterSet ParametersrapidityResProfilewclus2 = conf_.getParameter("TProfrapidityResProfilewclus2"); + edm::ParameterSet ParametersrapidityResProfilewclus2 = + conf_.getParameter("TProfrapidityResProfilewclus2"); layerswitchrapidityResProfilewclus2 = ParametersrapidityResProfilewclus2.getParameter("layerswitchon"); - edm::ParameterSet ParametersrapidityResProfilewclus3 = conf_.getParameter("TProfrapidityResProfilewclus3"); + edm::ParameterSet ParametersrapidityResProfilewclus3 = + conf_.getParameter("TProfrapidityResProfilewclus3"); layerswitchrapidityResProfilewclus3 = ParametersrapidityResProfilewclus3.getParameter("layerswitchon"); - edm::ParameterSet ParametersrapidityResProfilewclus4 = conf_.getParameter("TProfrapidityResProfilewclus4"); + edm::ParameterSet ParametersrapidityResProfilewclus4 = + conf_.getParameter("TProfrapidityResProfilewclus4"); layerswitchrapidityResProfilewclus4 = ParametersrapidityResProfilewclus4.getParameter("layerswitchon"); - - edm::ParameterSet ParametersWclusSas = conf_.getParameter("TH1WclusSas"); + + edm::ParameterSet ParametersWclusSas = conf_.getParameter("TH1WclusSas"); layerswitchWclusSas = ParametersWclusSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersAdcSas = conf_.getParameter("TH1AdcSas"); + edm::ParameterSet ParametersAdcSas = conf_.getParameter("TH1AdcSas"); layerswitchAdcSas = ParametersAdcSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxLFSas = conf_.getParameter("TH1ResolxLFSas"); + edm::ParameterSet ParametersResolxLFSas = conf_.getParameter("TH1ResolxLFSas"); layerswitchResolxLFSas = ParametersResolxLFSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFSas = conf_.getParameter("TH1ResolxMFSas"); + edm::ParameterSet ParametersResolxMFSas = conf_.getParameter("TH1ResolxMFSas"); layerswitchResolxMFSas = ParametersResolxMFSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersResLFSas = conf_.getParameter("TH1ResLFSas"); + edm::ParameterSet ParametersResLFSas = conf_.getParameter("TH1ResLFSas"); layerswitchResLFSas = ParametersResLFSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersResMFSas = conf_.getParameter("TH1ResMFSas"); + edm::ParameterSet ParametersResMFSas = conf_.getParameter("TH1ResMFSas"); layerswitchResMFSas = ParametersResMFSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullLFSas = conf_.getParameter("TH1PullLFSas"); + edm::ParameterSet ParametersPullLFSas = conf_.getParameter("TH1PullLFSas"); layerswitchPullLFSas = ParametersPullLFSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullMFSas = conf_.getParameter("TH1PullMFSas"); + edm::ParameterSet ParametersPullMFSas = conf_.getParameter("TH1PullMFSas"); layerswitchPullMFSas = ParametersPullMFSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersTrackangleSas = conf_.getParameter("TH1TrackangleSas"); + edm::ParameterSet ParametersTrackangleSas = conf_.getParameter("TH1TrackangleSas"); layerswitchTrackangleSas = ParametersTrackangleSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersTrackanglebetaSas = conf_.getParameter("TH1TrackanglebetaSas"); + edm::ParameterSet ParametersTrackanglebetaSas = conf_.getParameter("TH1TrackanglebetaSas"); layerswitchTrackanglebetaSas = ParametersTrackanglebetaSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullTrackangleProfileSas = conf_.getParameter("TProfPullTrackangleProfileSas"); + edm::ParameterSet ParametersPullTrackangleProfileSas = + conf_.getParameter("TProfPullTrackangleProfileSas"); layerswitchPullTrackangleProfileSas = ParametersPullTrackangleProfileSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersTrackwidthSas = conf_.getParameter("TH1TrackwidthSas"); + edm::ParameterSet ParametersTrackwidthSas = conf_.getParameter("TH1TrackwidthSas"); layerswitchTrackwidthSas = ParametersTrackwidthSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersExpectedwidthSas = conf_.getParameter("TH1ExpectedwidthSas"); + edm::ParameterSet ParametersExpectedwidthSas = conf_.getParameter("TH1ExpectedwidthSas"); layerswitchExpectedwidthSas = ParametersExpectedwidthSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersClusterwidthSas = conf_.getParameter("TH1ClusterwidthSas"); + edm::ParameterSet ParametersClusterwidthSas = conf_.getParameter("TH1ClusterwidthSas"); layerswitchClusterwidthSas = ParametersClusterwidthSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersCategorySas = conf_.getParameter("TH1CategorySas"); + edm::ParameterSet ParametersCategorySas = conf_.getParameter("TH1CategorySas"); layerswitchCategorySas = ParametersCategorySas.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullTrackwidthProfileSas = conf_.getParameter("TProfPullTrackwidthProfileSas"); + edm::ParameterSet ParametersPullTrackwidthProfileSas = + conf_.getParameter("TProfPullTrackwidthProfileSas"); layerswitchPullTrackwidthProfileSas = ParametersPullTrackwidthProfileSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullTrackwidthProfileCategory1Sas = conf_.getParameter("TProfPullTrackwidthProfileCategory1Sas"); - layerswitchPullTrackwidthProfileCategory1Sas = ParametersPullTrackwidthProfileCategory1Sas.getParameter("layerswitchon"); + edm::ParameterSet ParametersPullTrackwidthProfileCategory1Sas = + conf_.getParameter("TProfPullTrackwidthProfileCategory1Sas"); + layerswitchPullTrackwidthProfileCategory1Sas = + ParametersPullTrackwidthProfileCategory1Sas.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullTrackwidthProfileCategory2Sas = conf_.getParameter("TProfPullTrackwidthProfileCategory2Sas"); - layerswitchPullTrackwidthProfileCategory2Sas = ParametersPullTrackwidthProfileCategory2Sas.getParameter("layerswitchon"); + edm::ParameterSet ParametersPullTrackwidthProfileCategory2Sas = + conf_.getParameter("TProfPullTrackwidthProfileCategory2Sas"); + layerswitchPullTrackwidthProfileCategory2Sas = + ParametersPullTrackwidthProfileCategory2Sas.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullTrackwidthProfileCategory3Sas = conf_.getParameter("TProfPullTrackwidthProfileCategory3Sas"); - layerswitchPullTrackwidthProfileCategory3Sas = ParametersPullTrackwidthProfileCategory3Sas.getParameter("layerswitchon"); + edm::ParameterSet ParametersPullTrackwidthProfileCategory3Sas = + conf_.getParameter("TProfPullTrackwidthProfileCategory3Sas"); + layerswitchPullTrackwidthProfileCategory3Sas = + ParametersPullTrackwidthProfileCategory3Sas.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullTrackwidthProfileCategory4Sas = conf_.getParameter("TProfPullTrackwidthProfileCategory4Sas"); - layerswitchPullTrackwidthProfileCategory4Sas = ParametersPullTrackwidthProfileCategory4Sas.getParameter("layerswitchon"); + edm::ParameterSet ParametersPullTrackwidthProfileCategory4Sas = + conf_.getParameter("TProfPullTrackwidthProfileCategory4Sas"); + layerswitchPullTrackwidthProfileCategory4Sas = + ParametersPullTrackwidthProfileCategory4Sas.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFTrackwidthProfileSas = conf_.getParameter("TProfResolxMFTrackwidthProfileSas"); + edm::ParameterSet ParametersResolxMFTrackwidthProfileSas = + conf_.getParameter("TProfResolxMFTrackwidthProfileSas"); layerswitchResolxMFTrackwidthProfileSas = ParametersResolxMFTrackwidthProfileSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory1Sas = conf_.getParameter("TProfResolxMFTrackwidthProfileCategory1Sas"); - layerswitchResolxMFTrackwidthProfileCategory1Sas = ParametersResolxMFTrackwidthProfileCategory1Sas.getParameter("layerswitchon"); + edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory1Sas = + conf_.getParameter("TProfResolxMFTrackwidthProfileCategory1Sas"); + layerswitchResolxMFTrackwidthProfileCategory1Sas = + ParametersResolxMFTrackwidthProfileCategory1Sas.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory2Sas = conf_.getParameter("TProfResolxMFTrackwidthProfileCategory2Sas"); - layerswitchResolxMFTrackwidthProfileCategory2Sas = ParametersResolxMFTrackwidthProfileCategory2Sas.getParameter("layerswitchon"); + edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory2Sas = + conf_.getParameter("TProfResolxMFTrackwidthProfileCategory2Sas"); + layerswitchResolxMFTrackwidthProfileCategory2Sas = + ParametersResolxMFTrackwidthProfileCategory2Sas.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory3Sas = conf_.getParameter("TProfResolxMFTrackwidthProfileCategory3Sas"); - layerswitchResolxMFTrackwidthProfileCategory3Sas = ParametersResolxMFTrackwidthProfileCategory3Sas.getParameter("layerswitchon"); + edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory3Sas = + conf_.getParameter("TProfResolxMFTrackwidthProfileCategory3Sas"); + layerswitchResolxMFTrackwidthProfileCategory3Sas = + ParametersResolxMFTrackwidthProfileCategory3Sas.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory4Sas = conf_.getParameter("TProfResolxMFTrackwidthProfileCategory4Sas"); - layerswitchResolxMFTrackwidthProfileCategory4Sas = ParametersResolxMFTrackwidthProfileCategory4Sas.getParameter("layerswitchon"); + edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory4Sas = + conf_.getParameter("TProfResolxMFTrackwidthProfileCategory4Sas"); + layerswitchResolxMFTrackwidthProfileCategory4Sas = + ParametersResolxMFTrackwidthProfileCategory4Sas.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFAngleProfileSas = conf_.getParameter("TProfResolxMFAngleProfileSas"); + edm::ParameterSet ParametersResolxMFAngleProfileSas = + conf_.getParameter("TProfResolxMFAngleProfileSas"); layerswitchResolxMFAngleProfileSas = ParametersResolxMFAngleProfileSas.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMFClusterwidthProfileCategory1Sas = conf_.getParameter("TProfResolxMFClusterwidthProfileCategory1Sas"); - layerswitchResolxMFClusterwidthProfileCategory1Sas = ParametersResolxMFClusterwidthProfileCategory1Sas.getParameter("layerswitchon"); + edm::ParameterSet ParametersResolxMFClusterwidthProfileCategory1Sas = + conf_.getParameter("TProfResolxMFClusterwidthProfileCategory1Sas"); + layerswitchResolxMFClusterwidthProfileCategory1Sas = + ParametersResolxMFClusterwidthProfileCategory1Sas.getParameter("layerswitchon"); - edm::ParameterSet ParametersPosxMatched = conf_.getParameter("TH1PosxMatched"); + edm::ParameterSet ParametersPosxMatched = conf_.getParameter("TH1PosxMatched"); layerswitchPosxMatched = ParametersPosxMatched.getParameter("layerswitchon"); - edm::ParameterSet ParametersPosyMatched = conf_.getParameter("TH1PosyMatched"); + edm::ParameterSet ParametersPosyMatched = conf_.getParameter("TH1PosyMatched"); layerswitchPosyMatched = ParametersPosyMatched.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolxMatched = conf_.getParameter("TH1ResolxMatched"); + edm::ParameterSet ParametersResolxMatched = conf_.getParameter("TH1ResolxMatched"); layerswitchResolxMatched = ParametersResolxMatched.getParameter("layerswitchon"); - edm::ParameterSet ParametersResolyMatched = conf_.getParameter("TH1ResolyMatched"); + edm::ParameterSet ParametersResolyMatched = conf_.getParameter("TH1ResolyMatched"); layerswitchResolyMatched = ParametersResolyMatched.getParameter("layerswitchon"); - edm::ParameterSet ParametersResxMatched = conf_.getParameter("TH1ResxMatched"); + edm::ParameterSet ParametersResxMatched = conf_.getParameter("TH1ResxMatched"); layerswitchResxMatched = ParametersResxMatched.getParameter("layerswitchon"); - edm::ParameterSet ParametersResyMatched = conf_.getParameter("TH1ResyMatched"); + edm::ParameterSet ParametersResyMatched = conf_.getParameter("TH1ResyMatched"); layerswitchResyMatched = ParametersResyMatched.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullxMatched = conf_.getParameter("TH1PullxMatched"); + edm::ParameterSet ParametersPullxMatched = conf_.getParameter("TH1PullxMatched"); layerswitchPullxMatched = ParametersPullxMatched.getParameter("layerswitchon"); - edm::ParameterSet ParametersPullyMatched = conf_.getParameter("TH1PullyMatched"); + edm::ParameterSet ParametersPullyMatched = conf_.getParameter("TH1PullyMatched"); layerswitchPullyMatched = ParametersPullyMatched.getParameter("layerswitchon"); - } //Destructor -SiStripTrackingRecHitsValid::~SiStripTrackingRecHitsValid(){ -} +SiStripTrackingRecHitsValid::~SiStripTrackingRecHitsValid() {} //-------------------------------------------------------------------------------------------- -void SiStripTrackingRecHitsValid::bookHistograms(DQMStore::IBooker & ibooker,const edm::Run& run, const edm::EventSetup& es){ - +void SiStripTrackingRecHitsValid::bookHistograms(DQMStore::IBooker &ibooker, + const edm::Run &run, + const edm::EventSetup &es) { unsigned long long cacheID = es.get().cacheIdentifier(); if (m_cacheID_ != cacheID) { - m_cacheID_ = cacheID; - edm::LogInfo("SiStripRecHitsValid") <<"SiStripRecHitsValid::beginRun: " - << " Creating MEs for new Cabling "; - - createMEs(ibooker,es); + m_cacheID_ = cacheID; + edm::LogInfo("SiStripRecHitsValid") << "SiStripRecHitsValid::beginRun: " + << " Creating MEs for new Cabling "; + + createMEs(ibooker, es); } } - - void SiStripTrackingRecHitsValid::endJob() { - - //Only in standalone mode save local root file - if(runStandalone && outputMEsInRootFile){dbe_->save(outputFileName);} - + //Only in standalone mode save local root file + if (runStandalone && outputMEsInRootFile) { + dbe_->save(outputFileName); + } } // Functions that gets called by framework every event -void SiStripTrackingRecHitsValid::analyze(const edm::Event & e, const edm::EventSetup & es) -{ - - LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event(); - //cout << " Run = " << e.id().run() << " Event = " << e.id().event() << endl; +void SiStripTrackingRecHitsValid::analyze(const edm::Event &e, const edm::EventSetup &es) { + LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event(); + //cout << " Run = " << e.id().run() << " Event = " << e.id().event() << endl; int isrechitrphi = 0; int isrechitsas = 0; @@ -470,424 +571,491 @@ void SiStripTrackingRecHitsValid::analyze(const edm::Event & e, const edm::Event //Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); - const TrackerTopology* const tTopo = tTopoHandle.product(); + const TrackerTopology *const tTopo = tTopoHandle.product(); - edm::ESHandle < TrackerGeometry > pDD; - es.get < TrackerDigiGeometryRecord > ().get(pDD); - const TrackerGeometry & tracker(*pDD); + edm::ESHandle pDD; + es.get().get(pDD); + const TrackerGeometry &tracker(*pDD); const TrackerGeometry *tracker2; - edm::ESHandle < TrackerGeometry > estracker; - es.get < TrackerDigiGeometryRecord > ().get(estracker); + edm::ESHandle estracker; + es.get().get(estracker); tracker2 = &(*estracker); - edm::ESHandle < MagneticField > magfield; - es.get < IdealMagneticFieldRecord > ().get(magfield); + edm::ESHandle magfield; + es.get().get(magfield); - const MagneticField & magfield_(*magfield); + const MagneticField &magfield_(*magfield); magfield2_ = &magfield_; - edm::ESHandle < StripClusterParameterEstimator > stripcpe; - es.get < TkStripCPERecord > ().get("SimpleStripCPE", stripcpe); + edm::ESHandle stripcpe; + es.get().get("SimpleStripCPE", stripcpe); // Mangano's - edm::Handle < std::vector > trackCollectionHandle; + edm::Handle > trackCollectionHandle; e.getByToken(tracksInputToken_, trackCollectionHandle); edm::LogVerbatim("TrajectoryAnalyzer") << "trackColl->size(): " << trackCollectionHandle->size(); - auto const & tracks = *trackCollectionHandle; - for (auto const & track : tracks) { - - if (track.pt()<0.5) continue; + auto const &tracks = *trackCollectionHandle; + for (auto const &track : tracks) { + if (track.pt() < 0.5) + continue; edm::LogVerbatim("TrajectoryAnalyzer") << "this track has " << track.found() << " valid hits"; - - auto const & trajParams = track.extra()->trajParams(); - assert(trajParams.size()==track.recHitsSize()); + + auto const &trajParams = track.extra()->trajParams(); + assert(trajParams.size() == track.recHitsSize()); auto hb = track.recHitsBegin(); - for(unsigned int h=0;hisValid()) continue; + for (unsigned int h = 0; h < track.recHitsSize(); h++) { + auto recHit = *(hb + h); + if (!recHit->isValid()) + continue; auto ldir = trajParams[h].direction(); auto gmom = recHit->surface()->toGlobal(trajParams[h].momentum()); - if (gmom.perp() < 0.5) continue; // redundant... - { - + if (gmom.perp() < 0.5) + continue; // redundant... + { auto thit2 = recHit; DetId detid2 = thit2->geographicalId(); - const SiStripMatchedRecHit2D *matchedhit = dynamic_cast < const SiStripMatchedRecHit2D * >(thit2); - const SiStripRecHit2D *hit2d = dynamic_cast < const SiStripRecHit2D * >(thit2); - const SiStripRecHit1D *hit1d = dynamic_cast < const SiStripRecHit1D * >(thit2); + const SiStripMatchedRecHit2D *matchedhit = dynamic_cast(thit2); + const SiStripRecHit2D *hit2d = dynamic_cast(thit2); + const SiStripRecHit1D *hit1d = dynamic_cast(thit2); auto thit = thit2; detid = (thit)->geographicalId(); myid = detid.rawId(); - //Here due to the fact that the SiStripHistoId::getSubdetid complains when - //a subdet of 1 or 2 appears we add an if statement. - if(detid.subdetId()==1 ||detid.subdetId()==2 ){ - continue; + //Here due to the fact that the SiStripHistoId::getSubdetid complains when + //a subdet of 1 or 2 appears we add an if statement. + if (detid.subdetId() == 1 || detid.subdetId() == 2) { + continue; } SiStripHistoId hidmanager; - std::string label = hidmanager.getSubdetid(myid,tTopo,true); + std::string label = hidmanager.getSubdetid(myid, tTopo, true); // std::cout<< "label " << label << " and id " << detid.subdetId() << std::endl; - StripSubdetector StripSubdet = (StripSubdetector) detid; + StripSubdetector StripSubdet = (StripSubdetector)detid; //Variable to define the case we are dealing with std::string matchedmonorstereo; isrechitmatched = 0; - + if (matchedhit) { - isrechitmatched = 1; - const GluedGeomDet *gluedDet = (const GluedGeomDet *) tracker.idToDet(matchedhit->geographicalId()); - //Analysis - rechitanalysis_matched(ldir, thit2, gluedDet, associate, stripcpe, MatchStatus::matched); - // rechitmatched.push_back(rechitpro); + isrechitmatched = 1; + const GluedGeomDet *gluedDet = (const GluedGeomDet *)tracker.idToDet(matchedhit->geographicalId()); + //Analysis + rechitanalysis_matched(ldir, thit2, gluedDet, associate, stripcpe, MatchStatus::matched); + // rechitmatched.push_back(rechitpro); } - std::map::iterator iStereoAndMatchedME = StereoAndMatchedMEsMap.find(label); + std::map::iterator iStereoAndMatchedME = StereoAndMatchedMEsMap.find(label); //Filling Histograms for Matched hits if (isrechitmatched) { - - if(iStereoAndMatchedME != StereoAndMatchedMEsMap.end()){ - fillME(iStereoAndMatchedME->second.mePosxMatched,rechitpro.x); - fillME(iStereoAndMatchedME->second.mePosyMatched,rechitpro.y); - fillME(iStereoAndMatchedME->second.meResolxMatched,sqrt(rechitpro.resolxx)); - fillME(iStereoAndMatchedME->second.meResolyMatched,sqrt(rechitpro.resolyy)); - fillME(iStereoAndMatchedME->second.meResxMatched,rechitpro.resx); - fillME(iStereoAndMatchedME->second.meResyMatched,rechitpro.resy); - fillME(iStereoAndMatchedME->second.mePullxMatched,rechitpro.pullx); - fillME(iStereoAndMatchedME->second.mePullyMatched,rechitpro.pully); - } + if (iStereoAndMatchedME != StereoAndMatchedMEsMap.end()) { + fillME(iStereoAndMatchedME->second.mePosxMatched, rechitpro.x); + fillME(iStereoAndMatchedME->second.mePosyMatched, rechitpro.y); + fillME(iStereoAndMatchedME->second.meResolxMatched, sqrt(rechitpro.resolxx)); + fillME(iStereoAndMatchedME->second.meResolyMatched, sqrt(rechitpro.resolyy)); + fillME(iStereoAndMatchedME->second.meResxMatched, rechitpro.resx); + fillME(iStereoAndMatchedME->second.meResyMatched, rechitpro.resy); + fillME(iStereoAndMatchedME->second.mePullxMatched, rechitpro.pullx); + fillME(iStereoAndMatchedME->second.mePullyMatched, rechitpro.pully); + } } - + //Reset Variables here for the current event - isrechitrphi = 0; - isrechitsas = 0; - + isrechitrphi = 0; + isrechitsas = 0; + /////////////////////////////////////////////////////// // simple hits from matched hits /////////////////////////////////////////////////////// - + if (gmom.transverse() != 0) { - track_rapidity = gmom.eta(); + track_rapidity = gmom.eta(); } else { - track_rapidity = -999.0; + track_rapidity = -999.0; } if (matchedhit) { auto hm = matchedhit->monoHit(); - const SiStripRecHit2D *monohit = &hm; - // const GeomDetUnit * monodet=gdet->monoDet(); - GluedGeomDet *gdet = (GluedGeomDet *) tracker2->idToDet(matchedhit->geographicalId()); - - if (monohit) { - - isrechitrphi = 1; - - //Analysis - rechitanalysis_matched(ldir, thit2, gdet, associate, stripcpe, MatchStatus::monoHit); - - } - - auto s = matchedhit->stereoHit(); - const SiStripRecHit2D *stereohit = &s; - - if (stereohit) { - - isrechitsas = 1; - - //Analysis - rechitanalysis_matched(ldir, thit2, gdet, associate, stripcpe, MatchStatus::stereoHit); - } - } - - if (hit1d) { - // simple hits are mono or stereo - // cout<<"simple hit"<monoDet(); + GluedGeomDet *gdet = (GluedGeomDet *)tracker2->idToDet(matchedhit->geographicalId()); - //cout<<"simple hit stereo"<stereoHit(); + const SiStripRecHit2D *stereohit = &s; - const GeomDetUnit *det = tracker.idToDetUnit(detid2); - const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *) (det); - - //Analysis for hit1d mono - rechitanalysis(ldir, thit2, stripdet, stripcpe, associate, true); + if (stereohit) { + isrechitsas = 1; - } + //Analysis + rechitanalysis_matched(ldir, thit2, gdet, associate, stripcpe, MatchStatus::stereoHit); + } } - - if (hit2d) { - // simple hits are mono or stereo - // cout<<"simple hit"<::iterator iLayerME = LayerMEsMap.find(label); + std::map::iterator iLayerME = LayerMEsMap.find(label); if (isrechitrphi) { - fillME(simplehitsMEs.meCategory,rechitpro.category); - fillME(simplehitsMEs.meTrackwidth,rechitpro.trackwidth); - fillME(simplehitsMEs.meExpectedwidth,rechitpro.expectedwidth); - fillME(simplehitsMEs.meClusterwidth,rechitpro.clusiz); - fillME(simplehitsMEs.meTrackanglealpha,rechitpro.trackangle); - fillME(simplehitsMEs.meTrackanglebeta,rechitpro.trackanglebeta); - - fillME(simplehitsMEs.meResolxMFAngleProfile,rechitpro.trackangle, sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResolxMFTrackwidthProfile,rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); - - if (rechitpro.clusiz == 1) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus1,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResMFTrackwidthProfileWClus1,rechitpro.trackwidth, fabs(rechitpro.resxMF)); - } else if (rechitpro.clusiz == 2) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus2,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResMFTrackwidthProfileWClus2,rechitpro.trackwidth, fabs(rechitpro.resxMF)); - fillME(simplehitsMEs.meResMFTrackwidthProfileWClus21,rechitpro.trackwidth,fabs(rechitpro.resxMF)); - fillME(simplehitsMEs.meResMFTrackwidthProfileWClus22,rechitpro.trackwidth,fabs(rechitpro.resxMF)); - fillME(simplehitsMEs.meResMFTrackwidthProfileWClus23,rechitpro.trackwidth,fabs(rechitpro.resxMF)); - } else if (rechitpro.clusiz == 3) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus3,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResMFTrackwidthProfileWClus3,rechitpro.trackwidth, fabs(rechitpro.resxMF)); - } else if (rechitpro.clusiz == 4) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus4,rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResMFTrackwidthProfileWClus4,rechitpro.trackwidth, fabs(rechitpro.resxMF)); - } - - if (rechitpro.category == 1) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory1,rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResolxMFClusterwidthProfileCategory1,rechitpro.clusiz, sqrt(rechitpro.resolxxMF)); - } else if (rechitpro.category == 2) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory2,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - } else if (rechitpro.category == 3) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory3,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - } else if (rechitpro.category == 4) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory4,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - } - - fillME(simplehitsMEs.meResolxMF,sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResolxLF,sqrt(rechitpro.resolxx)); - fillME(simplehitsMEs.meResMF,rechitpro.resxMF); - fillME(simplehitsMEs.meResLF,rechitpro.resx); - fillME(simplehitsMEs.mePullMF,rechitpro.pullxMF); - fillME(simplehitsMEs.mePullLF,rechitpro.pullx); - - if(iLayerME != LayerMEsMap.end()){ - fillME(iLayerME->second.meWclusRphi,rechitpro.clusiz); - fillME(iLayerME->second.meAdcRphi,rechitpro.cluchg); - fillME(iLayerME->second.meResolxLFRphi,sqrt(rechitpro.resolxx)); - fillME(iLayerME->second.meResolxMFRphi,sqrt(rechitpro.resolxxMF)); - - if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.meResolxMFRphiwclus1,sqrt(rechitpro.resolxxMF));} - if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.meResolxMFRphiwclus2,sqrt(rechitpro.resolxxMF));} - if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.meResolxMFRphiwclus3,sqrt(rechitpro.resolxxMF));} - if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.meResolxMFRphiwclus4,sqrt(rechitpro.resolxxMF));} - - - fillME(iLayerME->second.meResLFRphi,rechitpro.resx); - fillME(iLayerME->second.meResMFRphi,rechitpro.resxMF); - - if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.merapidityResProfilewclus1,track_rapidity, fabs(rechitpro.resxMF));} - if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.merapidityResProfilewclus2,track_rapidity, fabs(rechitpro.resxMF));} - if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.merapidityResProfilewclus3,track_rapidity, fabs(rechitpro.resxMF));} - if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.merapidityResProfilewclus4,track_rapidity, fabs(rechitpro.resxMF));} - - if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.meResMFRphiwclus1,rechitpro.resxMF);} - if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.meResMFRphiwclus2,rechitpro.resxMF);} - if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.meResMFRphiwclus3,rechitpro.resxMF);} - if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.meResMFRphiwclus4,rechitpro.resxMF);} - - fillME(iLayerME->second.mePullLFRphi,rechitpro.pullx); - fillME(iLayerME->second.mePullMFRphi,rechitpro.pullxMF); - - if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.mePullMFRphiwclus1,rechitpro.pullxMF);} - if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.mePullMFRphiwclus2,rechitpro.pullxMF);} - if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.mePullMFRphiwclus3,rechitpro.pullxMF);} - if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.mePullMFRphiwclus4,rechitpro.pullxMF);} - - - fillME(iLayerME->second.meTrackangleRphi,rechitpro.trackangle); - fillME(iLayerME->second.mePullTrackangleProfileRphi,rechitpro.trackangle,fabs(rechitpro.pullxMF)); - - if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus1,rechitpro.trackwidth, fabs(rechitpro.pullxMF));} - if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus2,rechitpro.trackwidth, fabs(rechitpro.pullxMF));} - if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus3,rechitpro.trackwidth, fabs(rechitpro.pullxMF));} - if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus4,rechitpro.trackwidth, fabs(rechitpro.pullxMF));} - - - if (rechitpro.clusiz == 1) { - fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus1Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - fillME(iLayerME->second.meResMFTrackwidthProfileWclus1Rphi,rechitpro.trackwidth,fabs(rechitpro.resxMF)); - } - if (rechitpro.clusiz == 2) { - fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus2Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - fillME(iLayerME->second.meResMFTrackwidthProfileWclus2Rphi,rechitpro.trackwidth,fabs(rechitpro.resxMF)); - } - if (rechitpro.clusiz == 3) { - fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus3Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - fillME(iLayerME->second.meResMFTrackwidthProfileWclus3Rphi,rechitpro.trackwidth,fabs(rechitpro.resxMF)); - } - if (rechitpro.clusiz == 4) { - fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus4Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - fillME(iLayerME->second.meResMFTrackwidthProfileWclus4Rphi,rechitpro.trackwidth,fabs(rechitpro.resxMF)); - } - - - if (rechitpro.category == 1) { - fillME(iLayerME->second.mePullTrackwidthProfileCategory1Rphi,rechitpro.trackwidth,fabs(rechitpro.pullxMF)); - fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory1Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - fillME(iLayerME->second.meResolxMFClusterwidthProfileCategory1Rphi,rechitpro.clusiz,sqrt(rechitpro.resolxxMF)); - } else if(rechitpro.category == 2) { - fillME(iLayerME->second.mePullTrackwidthProfileCategory2Rphi,rechitpro.trackwidth,fabs(rechitpro.pullxMF)); - fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory2Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - } else if (rechitpro.category == 3) { - fillME(iLayerME->second.mePullTrackwidthProfileCategory3Rphi,rechitpro.trackwidth,fabs(rechitpro.pullxMF)); - fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory3Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - } else if (rechitpro.category == 4) { - fillME(iLayerME->second.mePullTrackwidthProfileCategory4Rphi,rechitpro.trackwidth,fabs(rechitpro.pullxMF)); - fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory4Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - } - - fillME(iLayerME->second.meTrackwidthRphi,rechitpro.trackwidth); - fillME(iLayerME->second.meExpectedwidthRphi,rechitpro.expectedwidth); - fillME(iLayerME->second.meClusterwidthRphi,rechitpro.clusiz); - fillME(iLayerME->second.meCategoryRphi,rechitpro.category); - fillME(iLayerME->second.meResolxMFTrackwidthProfileRphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - fillME(iLayerME->second.meResolxMFAngleProfileRphi,rechitpro.trackangle,sqrt(rechitpro.resolxxMF)); - } + fillME(simplehitsMEs.meCategory, rechitpro.category); + fillME(simplehitsMEs.meTrackwidth, rechitpro.trackwidth); + fillME(simplehitsMEs.meExpectedwidth, rechitpro.expectedwidth); + fillME(simplehitsMEs.meClusterwidth, rechitpro.clusiz); + fillME(simplehitsMEs.meTrackanglealpha, rechitpro.trackangle); + fillME(simplehitsMEs.meTrackanglebeta, rechitpro.trackanglebeta); + + fillME(simplehitsMEs.meResolxMFAngleProfile, rechitpro.trackangle, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResolxMFTrackwidthProfile, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + + if (rechitpro.clusiz == 1) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus1, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResMFTrackwidthProfileWClus1, rechitpro.trackwidth, fabs(rechitpro.resxMF)); + } else if (rechitpro.clusiz == 2) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus2, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResMFTrackwidthProfileWClus2, rechitpro.trackwidth, fabs(rechitpro.resxMF)); + fillME(simplehitsMEs.meResMFTrackwidthProfileWClus21, rechitpro.trackwidth, fabs(rechitpro.resxMF)); + fillME(simplehitsMEs.meResMFTrackwidthProfileWClus22, rechitpro.trackwidth, fabs(rechitpro.resxMF)); + fillME(simplehitsMEs.meResMFTrackwidthProfileWClus23, rechitpro.trackwidth, fabs(rechitpro.resxMF)); + } else if (rechitpro.clusiz == 3) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus3, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResMFTrackwidthProfileWClus3, rechitpro.trackwidth, fabs(rechitpro.resxMF)); + } else if (rechitpro.clusiz == 4) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus4, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResMFTrackwidthProfileWClus4, rechitpro.trackwidth, fabs(rechitpro.resxMF)); + } + + if (rechitpro.category == 1) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory1, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResolxMFClusterwidthProfileCategory1, rechitpro.clusiz, sqrt(rechitpro.resolxxMF)); + } else if (rechitpro.category == 2) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory2, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + } else if (rechitpro.category == 3) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory3, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + } else if (rechitpro.category == 4) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory4, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + } + + fillME(simplehitsMEs.meResolxMF, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResolxLF, sqrt(rechitpro.resolxx)); + fillME(simplehitsMEs.meResMF, rechitpro.resxMF); + fillME(simplehitsMEs.meResLF, rechitpro.resx); + fillME(simplehitsMEs.mePullMF, rechitpro.pullxMF); + fillME(simplehitsMEs.mePullLF, rechitpro.pullx); + + if (iLayerME != LayerMEsMap.end()) { + fillME(iLayerME->second.meWclusRphi, rechitpro.clusiz); + fillME(iLayerME->second.meAdcRphi, rechitpro.cluchg); + fillME(iLayerME->second.meResolxLFRphi, sqrt(rechitpro.resolxx)); + fillME(iLayerME->second.meResolxMFRphi, sqrt(rechitpro.resolxxMF)); + + if ((min(rechitpro.clusiz, 4) - 1) == 1) { + fillME(iLayerME->second.meResolxMFRphiwclus1, sqrt(rechitpro.resolxxMF)); + } + if ((min(rechitpro.clusiz, 4) - 1) == 2) { + fillME(iLayerME->second.meResolxMFRphiwclus2, sqrt(rechitpro.resolxxMF)); + } + if ((min(rechitpro.clusiz, 4) - 1) == 3) { + fillME(iLayerME->second.meResolxMFRphiwclus3, sqrt(rechitpro.resolxxMF)); + } + if ((min(rechitpro.clusiz, 4) - 1) == 4) { + fillME(iLayerME->second.meResolxMFRphiwclus4, sqrt(rechitpro.resolxxMF)); + } + + fillME(iLayerME->second.meResLFRphi, rechitpro.resx); + fillME(iLayerME->second.meResMFRphi, rechitpro.resxMF); + + if ((min(rechitpro.clusiz, 4) - 1) == 1) { + fillME(iLayerME->second.merapidityResProfilewclus1, track_rapidity, fabs(rechitpro.resxMF)); + } + if ((min(rechitpro.clusiz, 4) - 1) == 2) { + fillME(iLayerME->second.merapidityResProfilewclus2, track_rapidity, fabs(rechitpro.resxMF)); + } + if ((min(rechitpro.clusiz, 4) - 1) == 3) { + fillME(iLayerME->second.merapidityResProfilewclus3, track_rapidity, fabs(rechitpro.resxMF)); + } + if ((min(rechitpro.clusiz, 4) - 1) == 4) { + fillME(iLayerME->second.merapidityResProfilewclus4, track_rapidity, fabs(rechitpro.resxMF)); + } + + if ((min(rechitpro.clusiz, 4) - 1) == 1) { + fillME(iLayerME->second.meResMFRphiwclus1, rechitpro.resxMF); + } + if ((min(rechitpro.clusiz, 4) - 1) == 2) { + fillME(iLayerME->second.meResMFRphiwclus2, rechitpro.resxMF); + } + if ((min(rechitpro.clusiz, 4) - 1) == 3) { + fillME(iLayerME->second.meResMFRphiwclus3, rechitpro.resxMF); + } + if ((min(rechitpro.clusiz, 4) - 1) == 4) { + fillME(iLayerME->second.meResMFRphiwclus4, rechitpro.resxMF); + } + + fillME(iLayerME->second.mePullLFRphi, rechitpro.pullx); + fillME(iLayerME->second.mePullMFRphi, rechitpro.pullxMF); + + if ((min(rechitpro.clusiz, 4) - 1) == 1) { + fillME(iLayerME->second.mePullMFRphiwclus1, rechitpro.pullxMF); + } + if ((min(rechitpro.clusiz, 4) - 1) == 2) { + fillME(iLayerME->second.mePullMFRphiwclus2, rechitpro.pullxMF); + } + if ((min(rechitpro.clusiz, 4) - 1) == 3) { + fillME(iLayerME->second.mePullMFRphiwclus3, rechitpro.pullxMF); + } + if ((min(rechitpro.clusiz, 4) - 1) == 4) { + fillME(iLayerME->second.mePullMFRphiwclus4, rechitpro.pullxMF); + } + + fillME(iLayerME->second.meTrackangleRphi, rechitpro.trackangle); + fillME(iLayerME->second.mePullTrackangleProfileRphi, rechitpro.trackangle, fabs(rechitpro.pullxMF)); + + if ((min(rechitpro.clusiz, 4) - 1) == 1) { + fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus1, rechitpro.trackwidth, fabs(rechitpro.pullxMF)); + } + if ((min(rechitpro.clusiz, 4) - 1) == 2) { + fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus2, rechitpro.trackwidth, fabs(rechitpro.pullxMF)); + } + if ((min(rechitpro.clusiz, 4) - 1) == 3) { + fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus3, rechitpro.trackwidth, fabs(rechitpro.pullxMF)); + } + if ((min(rechitpro.clusiz, 4) - 1) == 4) { + fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus4, rechitpro.trackwidth, fabs(rechitpro.pullxMF)); + } + + if (rechitpro.clusiz == 1) { + fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus1Rphi, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + fillME(iLayerME->second.meResMFTrackwidthProfileWclus1Rphi, rechitpro.trackwidth, fabs(rechitpro.resxMF)); + } + if (rechitpro.clusiz == 2) { + fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus2Rphi, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + fillME(iLayerME->second.meResMFTrackwidthProfileWclus2Rphi, rechitpro.trackwidth, fabs(rechitpro.resxMF)); + } + if (rechitpro.clusiz == 3) { + fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus3Rphi, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + fillME(iLayerME->second.meResMFTrackwidthProfileWclus3Rphi, rechitpro.trackwidth, fabs(rechitpro.resxMF)); + } + if (rechitpro.clusiz == 4) { + fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus4Rphi, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + fillME(iLayerME->second.meResMFTrackwidthProfileWclus4Rphi, rechitpro.trackwidth, fabs(rechitpro.resxMF)); + } + + if (rechitpro.category == 1) { + fillME( + iLayerME->second.mePullTrackwidthProfileCategory1Rphi, rechitpro.trackwidth, fabs(rechitpro.pullxMF)); + fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory1Rphi, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + fillME(iLayerME->second.meResolxMFClusterwidthProfileCategory1Rphi, + rechitpro.clusiz, + sqrt(rechitpro.resolxxMF)); + } else if (rechitpro.category == 2) { + fillME( + iLayerME->second.mePullTrackwidthProfileCategory2Rphi, rechitpro.trackwidth, fabs(rechitpro.pullxMF)); + fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory2Rphi, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + } else if (rechitpro.category == 3) { + fillME( + iLayerME->second.mePullTrackwidthProfileCategory3Rphi, rechitpro.trackwidth, fabs(rechitpro.pullxMF)); + fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory3Rphi, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + } else if (rechitpro.category == 4) { + fillME( + iLayerME->second.mePullTrackwidthProfileCategory4Rphi, rechitpro.trackwidth, fabs(rechitpro.pullxMF)); + fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory4Rphi, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + } + + fillME(iLayerME->second.meTrackwidthRphi, rechitpro.trackwidth); + fillME(iLayerME->second.meExpectedwidthRphi, rechitpro.expectedwidth); + fillME(iLayerME->second.meClusterwidthRphi, rechitpro.clusiz); + fillME(iLayerME->second.meCategoryRphi, rechitpro.category); + fillME(iLayerME->second.meResolxMFTrackwidthProfileRphi, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + fillME(iLayerME->second.meResolxMFAngleProfileRphi, rechitpro.trackangle, sqrt(rechitpro.resolxxMF)); + } } if (isrechitsas > 0) { - fillME(simplehitsMEs.meCategory,rechitpro.category); - fillME(simplehitsMEs.meTrackwidth,rechitpro.trackwidth); - fillME(simplehitsMEs.meExpectedwidth,rechitpro.expectedwidth); - fillME(simplehitsMEs.meClusterwidth,rechitpro.clusiz); - fillME(simplehitsMEs.meTrackanglealpha,rechitpro.trackangle); - fillME(simplehitsMEs.meTrackanglebeta,rechitpro.trackanglebeta); - - fillME(simplehitsMEs.meResolxMFAngleProfile,rechitpro.trackangle, sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResolxMFTrackwidthProfile,rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); - - if (rechitpro.clusiz == 1) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus1,rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResMFTrackwidthProfileWClus1,rechitpro.trackwidth, rechitpro.resxMF); - } else if (rechitpro.clusiz == 2) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus2,rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResMFTrackwidthProfileWClus2,rechitpro.trackwidth, rechitpro.resxMF); - } else if (rechitpro.clusiz == 3) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus3,rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResMFTrackwidthProfileWClus3,rechitpro.trackwidth, rechitpro.resxMF); - } else if (rechitpro.clusiz == 4) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus4,rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResMFTrackwidthProfileWClus4,rechitpro.trackwidth, rechitpro.resxMF); - } if (rechitpro.category == 1) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory1,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResolxMFClusterwidthProfileCategory1,rechitpro.clusiz, sqrt(rechitpro.resolxxMF)); - } else if (rechitpro.category == 2) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory2,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - } else if (rechitpro.category == 3) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory3,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - } else if (rechitpro.category == 4) { - fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory4,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - } - - fillME(simplehitsMEs.meResolxMF,sqrt(rechitpro.resolxxMF)); - fillME(simplehitsMEs.meResolxLF,sqrt(rechitpro.resolxx)); - fillME(simplehitsMEs.meResMF,rechitpro.resxMF); - fillME(simplehitsMEs.meResLF,rechitpro.resx); - fillME(simplehitsMEs.mePullMF,rechitpro.pullxMF); - fillME(simplehitsMEs.mePullLF,rechitpro.pullx); - - if(iStereoAndMatchedME != StereoAndMatchedMEsMap.end()){ - fillME(iStereoAndMatchedME->second.meWclusSas,rechitpro.clusiz); - fillME(iStereoAndMatchedME->second.meAdcSas,rechitpro.cluchg); - fillME(iStereoAndMatchedME->second.meResolxLFSas,sqrt(rechitpro.resolxx)); - fillME(iStereoAndMatchedME->second.meResLFSas,rechitpro.resx); - fillME(iStereoAndMatchedME->second.mePullLFSas,rechitpro.pullx); - fillME(iStereoAndMatchedME->second.meResolxMFSas,sqrt(rechitpro.resolxxMF)); - fillME(iStereoAndMatchedME->second.meResMFSas,rechitpro.resxMF); - fillME(iStereoAndMatchedME->second.mePullMFSas,rechitpro.pullxMF); - fillME(iStereoAndMatchedME->second.meTrackangleSas,rechitpro.trackangle); - fillME(iStereoAndMatchedME->second.mePullTrackangleProfileSas,rechitpro.trackangle, rechitpro.pullxMF); - fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileSas,rechitpro.trackwidth, rechitpro.pullxMF); - if (rechitpro.category == 1) { - fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory1Sas,rechitpro.trackwidth,rechitpro.pullxMF); - fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory1Sas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - fillME(iStereoAndMatchedME->second.meResolxMFClusterwidthProfileCategory1Sas,rechitpro.clusiz,sqrt(rechitpro.resolxxMF)); - } else if (rechitpro.category == 2) { - fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory2Sas,rechitpro.trackwidth,rechitpro.pullxMF); - fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory2Sas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - } else if (rechitpro.category == 3) { - fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory3Sas,rechitpro.trackwidth,rechitpro.pullxMF); - fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory3Sas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - } else if (rechitpro.category == 4) { - fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory4Sas,rechitpro.trackwidth,rechitpro.pullxMF); - fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory4Sas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - } - fillME(iStereoAndMatchedME->second.meTrackwidthSas,rechitpro.trackwidth); - fillME(iStereoAndMatchedME->second.meExpectedwidthSas,rechitpro.expectedwidth); - fillME(iStereoAndMatchedME->second.meClusterwidthSas,rechitpro.clusiz); - fillME(iStereoAndMatchedME->second.meCategorySas,rechitpro.category); - fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileSas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF)); - fillME(iStereoAndMatchedME->second.meResolxMFAngleProfileSas,rechitpro.trackangle, rechitpro.resolxxMF); - } - } + fillME(simplehitsMEs.meCategory, rechitpro.category); + fillME(simplehitsMEs.meTrackwidth, rechitpro.trackwidth); + fillME(simplehitsMEs.meExpectedwidth, rechitpro.expectedwidth); + fillME(simplehitsMEs.meClusterwidth, rechitpro.clusiz); + fillME(simplehitsMEs.meTrackanglealpha, rechitpro.trackangle); + fillME(simplehitsMEs.meTrackanglebeta, rechitpro.trackanglebeta); + + fillME(simplehitsMEs.meResolxMFAngleProfile, rechitpro.trackangle, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResolxMFTrackwidthProfile, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + + if (rechitpro.clusiz == 1) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus1, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResMFTrackwidthProfileWClus1, rechitpro.trackwidth, rechitpro.resxMF); + } else if (rechitpro.clusiz == 2) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus2, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResMFTrackwidthProfileWClus2, rechitpro.trackwidth, rechitpro.resxMF); + } else if (rechitpro.clusiz == 3) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus3, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResMFTrackwidthProfileWClus3, rechitpro.trackwidth, rechitpro.resxMF); + } else if (rechitpro.clusiz == 4) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileWClus4, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResMFTrackwidthProfileWClus4, rechitpro.trackwidth, rechitpro.resxMF); + } + if (rechitpro.category == 1) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory1, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResolxMFClusterwidthProfileCategory1, rechitpro.clusiz, sqrt(rechitpro.resolxxMF)); + } else if (rechitpro.category == 2) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory2, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + } else if (rechitpro.category == 3) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory3, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + } else if (rechitpro.category == 4) { + fillME(simplehitsMEs.meResolxMFTrackwidthProfileCategory4, rechitpro.trackwidth, sqrt(rechitpro.resolxxMF)); + } + + fillME(simplehitsMEs.meResolxMF, sqrt(rechitpro.resolxxMF)); + fillME(simplehitsMEs.meResolxLF, sqrt(rechitpro.resolxx)); + fillME(simplehitsMEs.meResMF, rechitpro.resxMF); + fillME(simplehitsMEs.meResLF, rechitpro.resx); + fillME(simplehitsMEs.mePullMF, rechitpro.pullxMF); + fillME(simplehitsMEs.mePullLF, rechitpro.pullx); + + if (iStereoAndMatchedME != StereoAndMatchedMEsMap.end()) { + fillME(iStereoAndMatchedME->second.meWclusSas, rechitpro.clusiz); + fillME(iStereoAndMatchedME->second.meAdcSas, rechitpro.cluchg); + fillME(iStereoAndMatchedME->second.meResolxLFSas, sqrt(rechitpro.resolxx)); + fillME(iStereoAndMatchedME->second.meResLFSas, rechitpro.resx); + fillME(iStereoAndMatchedME->second.mePullLFSas, rechitpro.pullx); + fillME(iStereoAndMatchedME->second.meResolxMFSas, sqrt(rechitpro.resolxxMF)); + fillME(iStereoAndMatchedME->second.meResMFSas, rechitpro.resxMF); + fillME(iStereoAndMatchedME->second.mePullMFSas, rechitpro.pullxMF); + fillME(iStereoAndMatchedME->second.meTrackangleSas, rechitpro.trackangle); + fillME(iStereoAndMatchedME->second.mePullTrackangleProfileSas, rechitpro.trackangle, rechitpro.pullxMF); + fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileSas, rechitpro.trackwidth, rechitpro.pullxMF); + if (rechitpro.category == 1) { + fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory1Sas, + rechitpro.trackwidth, + rechitpro.pullxMF); + fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory1Sas, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + fillME(iStereoAndMatchedME->second.meResolxMFClusterwidthProfileCategory1Sas, + rechitpro.clusiz, + sqrt(rechitpro.resolxxMF)); + } else if (rechitpro.category == 2) { + fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory2Sas, + rechitpro.trackwidth, + rechitpro.pullxMF); + fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory2Sas, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + } else if (rechitpro.category == 3) { + fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory3Sas, + rechitpro.trackwidth, + rechitpro.pullxMF); + fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory3Sas, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + } else if (rechitpro.category == 4) { + fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory4Sas, + rechitpro.trackwidth, + rechitpro.pullxMF); + fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory4Sas, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + } + fillME(iStereoAndMatchedME->second.meTrackwidthSas, rechitpro.trackwidth); + fillME(iStereoAndMatchedME->second.meExpectedwidthSas, rechitpro.expectedwidth); + fillME(iStereoAndMatchedME->second.meClusterwidthSas, rechitpro.clusiz); + fillME(iStereoAndMatchedME->second.meCategorySas, rechitpro.category); + fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileSas, + rechitpro.trackwidth, + sqrt(rechitpro.resolxxMF)); + fillME(iStereoAndMatchedME->second.meResolxMFAngleProfileSas, rechitpro.trackangle, rechitpro.resolxxMF); + } + } } } } } - - //needed by to do the residual for matched hits -std::pair < LocalPoint, LocalVector > SiStripTrackingRecHitsValid::projectHit(const PSimHit & hit, - const StripGeomDetUnit - * stripDet, - const BoundPlane & - plane) -{ +std::pair SiStripTrackingRecHitsValid::projectHit(const PSimHit &hit, + const StripGeomDetUnit *stripDet, + const BoundPlane &plane) { // const StripGeomDetUnit* stripDet = dynamic_cast(hit.det()); //if (stripDet == 0) throw MeasurementDetException("HitMatcher hit is not on StripGeomDetUnit"); - const StripTopology & topol = stripDet->specificTopology(); + const StripTopology &topol = stripDet->specificTopology(); GlobalPoint globalpos = stripDet->surface().toGlobal(hit.localPosition()); LocalPoint localHit = plane.toLocal(globalpos); //track direction @@ -904,58 +1072,68 @@ std::pair < LocalPoint, LocalVector > SiStripTrackingRecHitsValid::projectHit(co float selfAngle = topol.stripAngle(topol.strip(hit.localPosition())); - LocalVector stripDir(sin(selfAngle), cos(selfAngle), 0); // vector along strip in hit frame + LocalVector stripDir(sin(selfAngle), cos(selfAngle), 0); // vector along strip in hit frame LocalVector localStripDir(plane.toLocal(stripDet->surface().toGlobal(stripDir))); - return std::pair < LocalPoint, LocalVector > (projectedPos, localStripDir); + return std::pair(projectedPos, localStripDir); } //-------------------------------------------------------------------------------------------- -void SiStripTrackingRecHitsValid::rechitanalysis_matched(LocalVector ldir, const TrackingRecHit *rechit, const GluedGeomDet* gluedDet, TrackerHitAssociator& associate, edm::ESHandle stripcpe, const MatchStatus matchedmonorstereo){ - - rechitpro.resx = -999999.; rechitpro.resy = -999999.; rechitpro.resxMF = -999999.; - rechitpro.pullx = -999999.; rechitpro.pully = -999999.; rechitpro.pullxMF = -999999.; rechitpro.trackangle = -999999.; rechitpro.trackanglebeta = -999999.; - - const GeomDetUnit *monodet = gluedDet->monoDet(); +void SiStripTrackingRecHitsValid::rechitanalysis_matched(LocalVector ldir, + const TrackingRecHit *rechit, + const GluedGeomDet *gluedDet, + TrackerHitAssociator &associate, + edm::ESHandle stripcpe, + const MatchStatus matchedmonorstereo) { + rechitpro.resx = -999999.; + rechitpro.resy = -999999.; + rechitpro.resxMF = -999999.; + rechitpro.pullx = -999999.; + rechitpro.pully = -999999.; + rechitpro.pullxMF = -999999.; + rechitpro.trackangle = -999999.; + rechitpro.trackanglebeta = -999999.; + + const GeomDetUnit *monodet = gluedDet->monoDet(); const GeomDetUnit *stereodet = gluedDet->stereoDet(); //We initialized it to monoHit case because it complains that it may be uninitialized //and it will change value in the stereoHit case. The matched case do not use this - const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *) (monodet) ; + const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *)(monodet); - const SiStripMatchedRecHit2D *matchedhit = dynamic_cast < const SiStripMatchedRecHit2D * > (rechit); + const SiStripMatchedRecHit2D *matchedhit = dynamic_cast(rechit); const SiStripRecHit2D *monohit = nullptr; const SiStripRecHit2D *stereohit = nullptr; SiStripRecHit2D::ClusterRef clust; - - if (matchedmonorstereo == MatchStatus::monoHit){ + + if (matchedmonorstereo == MatchStatus::monoHit) { auto hm = matchedhit->monoHit(); monohit = &hm; - stripdet = (const StripGeomDetUnit *) (monodet); - } else if (matchedmonorstereo == MatchStatus::stereoHit){ + stripdet = (const StripGeomDetUnit *)(monodet); + } else if (matchedmonorstereo == MatchStatus::stereoHit) { auto s = matchedhit->stereoHit(); stereohit = &s; - stripdet = (const StripGeomDetUnit *) (stereodet); + stripdet = (const StripGeomDetUnit *)(stereodet); } //if(matchedhit) cout<<"manganomatchedhit"<topology(); + const StripTopology &topol = (const StripTopology &)stripdet->topology(); - const LocalVector& trackdirection = ldir; + const LocalVector &trackdirection = ldir; GlobalVector gtrkdir = gluedDet->toGlobal(trackdirection); LocalVector monotkdir = monodet->toLocal(gtrkdir); LocalVector stereotkdir = stereodet->toLocal(gtrkdir); - + LocalPoint position; LocalError error; MeasurementPoint Mposition; MeasurementError Merror; - if (matchedmonorstereo == MatchStatus::matched){ - position=rechit->localPosition(); - error=rechit->localPositionError(); - } else if(matchedmonorstereo == MatchStatus::monoHit){ + if (matchedmonorstereo == MatchStatus::matched) { + position = rechit->localPosition(); + error = rechit->localPositionError(); + } else if (matchedmonorstereo == MatchStatus::monoHit) { position = monohit->localPosition(); error = monohit->localPositionError(); Mposition = topol.measurementPosition(position); @@ -964,8 +1142,8 @@ void SiStripTrackingRecHitsValid::rechitanalysis_matched(LocalVector ldir, const rechitpro.trackangle = atan(monotkdir.x() / monotkdir.z()) * TMath::RadToDeg(); rechitpro.trackanglebeta = atan(monotkdir.y() / monotkdir.z()) * TMath::RadToDeg(); } - clust = monohit->cluster(); - } else if (matchedmonorstereo == MatchStatus::stereoHit){ + clust = monohit->cluster(); + } else if (matchedmonorstereo == MatchStatus::stereoHit) { position = stereohit->localPosition(); error = stereohit->localPositionError(); Mposition = topol.measurementPosition(position); @@ -984,15 +1162,15 @@ void SiStripTrackingRecHitsValid::rechitanalysis_matched(LocalVector ldir, const float tanalphaL = drift.x() / drift.z(); rechitpro.trackwidth = fabs((rechitpro.thickness / pitch) * tanalpha - (rechitpro.thickness / pitch) * tanalphaL); float SLorentz = 0.5 * (rechitpro.thickness / pitch) * tanalphaL; - int Sp = int (position.x() / pitch + SLorentz + 0.5 * rechitpro.trackwidth); - int Sm = int (position.x() / pitch + SLorentz - 0.5 * rechitpro.trackwidth); + int Sp = int(position.x() / pitch + SLorentz + 0.5 * rechitpro.trackwidth); + int Sm = int(position.x() / pitch + SLorentz - 0.5 * rechitpro.trackwidth); rechitpro.expectedwidth = 1 + Sp - Sm; - const auto & amplitudes=clust->amplitudes(); + const auto &litudes = clust->amplitudes(); rechitpro.clusiz = amplitudes.size(); - int totcharge=0; - for(size_t ia=0; ia rechitpro.expectedwidth + 2) { rechitpro.category = 1; } else if (rechitpro.expectedwidth == 1) { @@ -1014,32 +1192,39 @@ void SiStripTrackingRecHitsValid::rechitanalysis_matched(LocalVector ldir, const rechitpro.category = 4; } - if(matchedmonorstereo == MatchStatus::matched){matched.clear();matched = associate.associateHit(*matchedhit);} - else if(matchedmonorstereo == MatchStatus::monoHit){matched.clear();matched = associate.associateHit(*monohit);} - else if(matchedmonorstereo == MatchStatus::stereoHit){matched.clear();matched = associate.associateHit(*stereohit);} + if (matchedmonorstereo == MatchStatus::matched) { + matched.clear(); + matched = associate.associateHit(*matchedhit); + } else if (matchedmonorstereo == MatchStatus::monoHit) { + matched.clear(); + matched = associate.associateHit(*monohit); + } else if (matchedmonorstereo == MatchStatus::stereoHit) { + matched.clear(); + matched = associate.associateHit(*stereohit); + } - if(!matched.empty()){ + if (!matched.empty()) { float mindist = std::numeric_limits::max(); float dist = std::numeric_limits::max(); float distx = std::numeric_limits::max(); float disty = std::numeric_limits::max(); - std::pair closestPair; - PSimHit* closest = nullptr; - - const StripGeomDetUnit* partnerstripdet = static_cast(gluedDet->stereoDet()); - std::pair hitPair; - - if (matchedmonorstereo ==MatchStatus::matched) { - for(auto &m : matched){ + std::pair closestPair; + PSimHit *closest = nullptr; + + const StripGeomDetUnit *partnerstripdet = static_cast(gluedDet->stereoDet()); + std::pair hitPair; + + if (matchedmonorstereo == MatchStatus::matched) { + for (auto &m : matched) { //project simhit; - hitPair= projectHit(m,partnerstripdet,gluedDet->surface()); - distx = fabs(rechitpro.x - hitPair.first.x()); - disty = fabs(rechitpro.y - hitPair.first.y()); - dist = sqrt(distx*distx+disty*disty); - if(distsurface()); + distx = fabs(rechitpro.x - hitPair.first.x()); + disty = fabs(rechitpro.y - hitPair.first.y()); + dist = sqrt(distx * distx + disty * disty); + if (dist < mindist) { + mindist = dist; + closestPair = hitPair; + closest = &m; } } float closestX = closestPair.first.x(); @@ -1048,57 +1233,65 @@ void SiStripTrackingRecHitsValid::rechitanalysis_matched(LocalVector ldir, const rechitpro.resy = rechitpro.y - closestPair.first.y(); rechitpro.pullx = ((rechit)->localPosition().x() - closestX) / sqrt(error.xx()); rechitpro.pully = ((rechit)->localPosition().y() - closestY) / sqrt(error.yy()); - } else if(matchedmonorstereo == MatchStatus::monoHit){ - for(auto &m : matched ){ + } else if (matchedmonorstereo == MatchStatus::monoHit) { + for (auto &m : matched) { //project simhit; dist = abs((monohit)->localPosition().x() - m.localPosition().x()); - if(distlocalPosition().x(); rechitpro.resx = rechitpro.x - closestX; rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x(); rechitpro.pullx = (rechit->localPosition().x() - closestX) / sqrt(error.xx()); - rechitpro.pullxMF = (rechitpro.resxMF)/sqrt(Merror.uu()); - } else if(matchedmonorstereo == MatchStatus::stereoHit){ - for(auto &m : matched){ + rechitpro.pullxMF = (rechitpro.resxMF) / sqrt(Merror.uu()); + } else if (matchedmonorstereo == MatchStatus::stereoHit) { + for (auto &m : matched) { //project simhit; dist = abs((stereohit)->localPosition().x() - m.localPosition().x()); - if(distlocalPosition().x(); + float closestX = closest->localPosition().x(); rechitpro.resx = rechitpro.x - closestX; rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x(); rechitpro.pullx = (rechit->localPosition().x() - closestX) / sqrt(error.xx()); - rechitpro.pullxMF = (rechitpro.resxMF)/sqrt(Merror.uu()); + rechitpro.pullxMF = (rechitpro.resxMF) / sqrt(Merror.uu()); } } } //-------------------------------------------------------------------------------------------- -void SiStripTrackingRecHitsValid::rechitanalysis(LocalVector ldir, const TrackingRecHit *rechit, const StripGeomDetUnit *stripdet,edm::ESHandle stripcpe, TrackerHitAssociator& associate, bool simplehit1or2D){ +void SiStripTrackingRecHitsValid::rechitanalysis(LocalVector ldir, + const TrackingRecHit *rechit, + const StripGeomDetUnit *stripdet, + edm::ESHandle stripcpe, + TrackerHitAssociator &associate, + bool simplehit1or2D) { + rechitpro.resx = -999999.; + rechitpro.resy = -999999.; + rechitpro.resxMF = -999999.; + rechitpro.pullx = -999999.; + rechitpro.pully = -999999.; + rechitpro.pullxMF = -999999.; - rechitpro.resx = -999999.; rechitpro.resy = -999999.; rechitpro.resxMF = -999999.; - rechitpro.pullx = -999999.; rechitpro.pully = -999999.; rechitpro.pullxMF = -999999.; - //If simplehit1or2D is true we are dealing with hit1d, false is for hit2d - const SiStripRecHit2D *hit2d = dynamic_cast < const SiStripRecHit2D * >(rechit); - const SiStripRecHit1D *hit1d = dynamic_cast < const SiStripRecHit1D * >(rechit); + const SiStripRecHit2D *hit2d = dynamic_cast(rechit); + const SiStripRecHit1D *hit1d = dynamic_cast(rechit); - const StripTopology & topol = (const StripTopology &) stripdet->topology(); + const StripTopology &topol = (const StripTopology &)stripdet->topology(); LocalPoint position = rechit->localPosition(); LocalError error = rechit->localPositionError(); MeasurementPoint Mposition = topol.measurementPosition(position); - MeasurementError Merror = topol.measurementError(position,error); - - const LocalVector& trackdirection = ldir; + MeasurementError Merror = topol.measurementError(position, error); + + const LocalVector &trackdirection = ldir; rechitpro.trackangle = std::atan(trackdirection.x() / trackdirection.z()) * TMath::RadToDeg(); rechitpro.trackanglebeta = std::atan(trackdirection.y() / trackdirection.z()) * TMath::RadToDeg(); @@ -1109,26 +1302,26 @@ void SiStripTrackingRecHitsValid::rechitanalysis(LocalVector ldir, const Trackin float tanalphaL = drift.x() / drift.z(); rechitpro.trackwidth = fabs((rechitpro.thickness / pitch) * tanalpha - (rechitpro.thickness / pitch) * tanalphaL); float SLorentz = 0.5 * (rechitpro.thickness / pitch) * tanalphaL; - int Sp = int (position.x() / pitch + SLorentz + 0.5 * rechitpro.trackwidth); - int Sm = int (position.x() / pitch + SLorentz - 0.5 * rechitpro.trackwidth); + int Sp = int(position.x() / pitch + SLorentz + 0.5 * rechitpro.trackwidth); + int Sm = int(position.x() / pitch + SLorentz - 0.5 * rechitpro.trackwidth); rechitpro.expectedwidth = 1 + Sp - Sm; - int totcharge=0; - if(simplehit1or2D){ + int totcharge = 0; + if (simplehit1or2D) { SiStripRecHit1D::ClusterRef clust1d; clust1d = hit1d->cluster(); - const auto & amplitudes1d = clust1d->amplitudes(); + const auto &litudes1d = clust1d->amplitudes(); rechitpro.clusiz = amplitudes1d.size(); - for(size_t ia=0; iacluster(); - const auto & amplitudes2d = clust2d->amplitudes(); + const auto &litudes2d = clust2d->amplitudes(); rechitpro.clusiz = amplitudes2d.size(); - for(size_t ia=0; ia::max(); float dist = std::numeric_limits::max(); - PSimHit* closest = nullptr; - - if(simplehit1or2D){ + PSimHit *closest = nullptr; + + if (simplehit1or2D) { matched = associate.associateHit(*hit1d); - if(!matched.empty()){ - for(auto &m : matched ){ + if (!matched.empty()) { + for (auto &m : matched) { dist = abs((hit1d)->localPosition().x() - m.localPosition().x()); - if(distlocalPosition().x(); rechitpro.resx = rechitpro.x - closestX; rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x(); rechitpro.pullx = (rechit->localPosition().x() - closestX) / sqrt(error.xx()); - rechitpro.pullxMF = (rechitpro.resxMF)/sqrt(Merror.uu()); + rechitpro.pullxMF = (rechitpro.resxMF) / sqrt(Merror.uu()); } } else { matched = associate.associateHit(*hit2d); - if(!matched.empty()){ - for(auto &m : matched ){ + if (!matched.empty()) { + for (auto &m : matched) { dist = abs((hit2d)->localPosition().x() - m.localPosition().x()); - if(distlocalPosition().x(); + float closestX = closest->localPosition().x(); rechitpro.resx = rechitpro.x - closestX; rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x(); rechitpro.pullx = (rechit->localPosition().x() - closestX) / sqrt(error.xx()); - rechitpro.pullxMF = (rechitpro.resxMF)/sqrt(Merror.uu()); + rechitpro.pullxMF = (rechitpro.resxMF) / sqrt(Merror.uu()); } } } //-------------------------------------------------------------------------------------------- -void SiStripTrackingRecHitsValid::createMEs(DQMStore::IBooker & ibooker,const edm::EventSetup& es){ - +void SiStripTrackingRecHitsValid::createMEs(DQMStore::IBooker &ibooker, const edm::EventSetup &es) { //Retrieve tracker topology from geometry edm::ESHandle tTopoHandle; es.get().get(tTopoHandle); - const TrackerTopology* const tTopo = tTopoHandle.product(); - + const TrackerTopology *const tTopo = tTopoHandle.product(); + // take from eventSetup the SiStripDetCabling object - here will use SiStripDetControl later on es.get().get(SiStripDetCabling_); - - // get list of active detectors from SiStripDetCabling + + // get list of active detectors from SiStripDetCabling std::vector activeDets; SiStripDetCabling_->addActiveDetectorsRawIds(activeDets); @@ -1216,110 +1408,111 @@ void SiStripTrackingRecHitsValid::createMEs(DQMStore::IBooker & ibooker,const ed createSimpleHitsMEs(ibooker); // loop over detectors and book MEs - edm::LogInfo("SiStripTrackingRecHitsValid|SiStripTrackingRecHitsValid")<<"nr. of activeDets: "<::iterator detid_iterator = activeDets.begin(), detid_end = activeDets.end(); detid_iterator!=detid_end; ++detid_iterator){ + edm::LogInfo("SiStripTrackingRecHitsValid|SiStripTrackingRecHitsValid") + << "nr. of activeDets: " << activeDets.size(); + const std::string &tec = "TEC", tid = "TID", tob = "TOB", tib = "TIB"; + for (std::vector::iterator detid_iterator = activeDets.begin(), detid_end = activeDets.end(); + detid_iterator != detid_end; + ++detid_iterator) { uint32_t detid = (*detid_iterator); // remove any eventual zero elements - there should be none, but just in case - if(detid == 0) { + if (detid == 0) { activeDets.erase(detid_iterator); continue; } - + // Create Layer Level MEs - std::pair det_layer_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,true); + std::pair det_layer_pair = folder_organizer.GetSubDetAndLayer(detid, tTopo, true); SiStripHistoId hidmanager; - std::string label = hidmanager.getSubdetid(detid,tTopo,true); + std::string label = hidmanager.getSubdetid(detid, tTopo, true); // std::cout << "label " << label << endl; - - std::map::iterator iLayerME = LayerMEsMap.find(label); - if(iLayerME==LayerMEsMap.end()) { - + + std::map::iterator iLayerME = LayerMEsMap.find(label); + if (iLayerME == LayerMEsMap.end()) { // get detids for the layer - // Keep in mind that when we are on the TID or TEC we deal with rings not wheel + // Keep in mind that when we are on the TID or TEC we deal with rings not wheel int32_t lnumber = det_layer_pair.second; - const std::string& lname = det_layer_pair.first; - std::vector layerDetIds; - if (lname == tec) { + const std::string &lname = det_layer_pair.first; + std::vector layerDetIds; + if (lname == tec) { if (lnumber > 0) { - SiStripSubStructure::getTECDetectors(activeDets,layerDetIds,tTopo,2,0,0,0,abs(lnumber),0); + SiStripSubStructure::getTECDetectors(activeDets, layerDetIds, tTopo, 2, 0, 0, 0, abs(lnumber), 0); } else if (lnumber < 0) { - SiStripSubStructure::getTECDetectors(activeDets,layerDetIds,tTopo,1,0,0,0,abs(lnumber),0); + SiStripSubStructure::getTECDetectors(activeDets, layerDetIds, tTopo, 1, 0, 0, 0, abs(lnumber), 0); } } else if (lname == tid) { if (lnumber > 0) { - SiStripSubStructure::getTIDDetectors(activeDets,layerDetIds,tTopo,2,0,abs(lnumber),0); + SiStripSubStructure::getTIDDetectors(activeDets, layerDetIds, tTopo, 2, 0, abs(lnumber), 0); } else if (lnumber < 0) { - SiStripSubStructure::getTIDDetectors(activeDets,layerDetIds,tTopo,1,0,abs(lnumber),0); + SiStripSubStructure::getTIDDetectors(activeDets, layerDetIds, tTopo, 1, 0, abs(lnumber), 0); } } else if (lname == tob) { - SiStripSubStructure::getTOBDetectors(activeDets,layerDetIds,tTopo,lnumber,0,0); + SiStripSubStructure::getTOBDetectors(activeDets, layerDetIds, tTopo, lnumber, 0, 0); } else if (lname == tib) { - SiStripSubStructure::getTIBDetectors(activeDets,layerDetIds,tTopo,lnumber,0,0,0); + SiStripSubStructure::getTIBDetectors(activeDets, layerDetIds, tTopo, lnumber, 0, 0, 0); } LayerDetMap[label] = layerDetIds; - // book Layer MEs - folder_organizer.setLayerFolder(detid,tTopo,det_layer_pair.second,true); + // book Layer MEs + folder_organizer.setLayerFolder(detid, tTopo, det_layer_pair.second, true); // std::stringstream ss; - // folder_organizer.getLayerFolderName(ss, detid, tTopo, true); + // folder_organizer.getLayerFolderName(ss, detid, tTopo, true); // std::cout << "Folder Name " << ss.str().c_str() << std::endl; // folder_organizer.setLayerFolder(detid,det_layer_pair.second,true); - createLayerMEs(ibooker,label); + createLayerMEs(ibooker, label); } //Create StereoAndMatchedMEs - std::map::iterator iStereoAndMatchedME = StereoAndMatchedMEsMap.find(label); - if(iStereoAndMatchedME==StereoAndMatchedMEsMap.end()) { - + std::map::iterator iStereoAndMatchedME = StereoAndMatchedMEsMap.find(label); + if (iStereoAndMatchedME == StereoAndMatchedMEsMap.end()) { // get detids for the stereo and matched layer. We are going to need a bool for these layers bool isStereo = false; - // Keep in mind that when we are on the TID or TEC we deal with rings not wheel - std::vector stereoandmatchedDetIds; + // Keep in mind that when we are on the TID or TEC we deal with rings not wheel + std::vector stereoandmatchedDetIds; int32_t stereolnumber = det_layer_pair.second; - const std::string& stereolname = det_layer_pair.first; - if ( stereolname == tec && (tTopo->tecIsStereo(detid)) ) { - if ( stereolnumber > 0 ) { - SiStripSubStructure::getTECDetectors(activeDets,stereoandmatchedDetIds,tTopo,2,0,0,0,abs(stereolnumber),1); + const std::string &stereolname = det_layer_pair.first; + if (stereolname == tec && (tTopo->tecIsStereo(detid))) { + if (stereolnumber > 0) { + SiStripSubStructure::getTECDetectors( + activeDets, stereoandmatchedDetIds, tTopo, 2, 0, 0, 0, abs(stereolnumber), 1); isStereo = true; - } else if ( stereolnumber < 0 ) { - SiStripSubStructure::getTECDetectors(activeDets,stereoandmatchedDetIds,tTopo,1,0,0,0,abs(stereolnumber),1); + } else if (stereolnumber < 0) { + SiStripSubStructure::getTECDetectors( + activeDets, stereoandmatchedDetIds, tTopo, 1, 0, 0, 0, abs(stereolnumber), 1); isStereo = true; } - } else if ( stereolname == tid && (tTopo->tidIsStereo(detid)) ) { - if ( stereolnumber > 0 ) { - SiStripSubStructure::getTIDDetectors(activeDets,stereoandmatchedDetIds,tTopo,2,0,abs(stereolnumber),1); + } else if (stereolname == tid && (tTopo->tidIsStereo(detid))) { + if (stereolnumber > 0) { + SiStripSubStructure::getTIDDetectors(activeDets, stereoandmatchedDetIds, tTopo, 2, 0, abs(stereolnumber), 1); isStereo = true; - } else if ( stereolnumber < 0 ) { - SiStripSubStructure::getTIDDetectors(activeDets,stereoandmatchedDetIds,tTopo,1,0,abs(stereolnumber),1); + } else if (stereolnumber < 0) { + SiStripSubStructure::getTIDDetectors(activeDets, stereoandmatchedDetIds, tTopo, 1, 0, abs(stereolnumber), 1); isStereo = true; } - } else if ( stereolname == tob && (tTopo->tobIsStereo(detid)) ) { - SiStripSubStructure::getTOBDetectors(activeDets,stereoandmatchedDetIds,tTopo,stereolnumber,0,0); + } else if (stereolname == tob && (tTopo->tobIsStereo(detid))) { + SiStripSubStructure::getTOBDetectors(activeDets, stereoandmatchedDetIds, tTopo, stereolnumber, 0, 0); isStereo = true; - } else if ( stereolname == tib && (tTopo->tibIsStereo(detid)) ) { - SiStripSubStructure::getTIBDetectors(activeDets,stereoandmatchedDetIds,tTopo,stereolnumber,0,0,0); + } else if (stereolname == tib && (tTopo->tibIsStereo(detid))) { + SiStripSubStructure::getTIBDetectors(activeDets, stereoandmatchedDetIds, tTopo, stereolnumber, 0, 0, 0); isStereo = true; } StereoAndMatchedDetMap[label] = stereoandmatchedDetIds; - // book StereoAndMatched MEs - if(isStereo){ - folder_organizer.setLayerFolder(detid,tTopo,det_layer_pair.second,true); - // std::stringstream ss1; - // folder_organizer.getLayerFolderName(ss1, detid, tTopo, true); - // std::cout << "Folder Name stereo " << ss1.str().c_str() << std::endl; - //Create the Monitor Elements only when we have a stereo module - createStereoAndMatchedMEs(ibooker,label); + // book StereoAndMatched MEs + if (isStereo) { + folder_organizer.setLayerFolder(detid, tTopo, det_layer_pair.second, true); + // std::stringstream ss1; + // folder_organizer.getLayerFolderName(ss1, detid, tTopo, true); + // std::cout << "Folder Name stereo " << ss1.str().c_str() << std::endl; + //Create the Monitor Elements only when we have a stereo module + createStereoAndMatchedMEs(ibooker, label); } } - - }//end of loop over detectors + } //end of loop over detectors } //------------------------------------------------------------------------------------------ -void SiStripTrackingRecHitsValid::createSimpleHitsMEs(DQMStore::IBooker & ibooker) -{ +void SiStripTrackingRecHitsValid::createSimpleHitsMEs(DQMStore::IBooker &ibooker) { simplehitsMEs.meCategory = nullptr; simplehitsMEs.meTrackwidth = nullptr; simplehitsMEs.meExpectedwidth = nullptr; @@ -1352,156 +1545,225 @@ void SiStripTrackingRecHitsValid::createSimpleHitsMEs(DQMStore::IBooker & ibooke simplehitsMEs.meResolxMF = nullptr; simplehitsMEs.meResMF = nullptr; simplehitsMEs.mePullMF = nullptr; - - if(layerswitchResolx_LF) { - simplehitsMEs.meResolxLF = bookME1D(ibooker,"TH1Resolx_LF", "TH1Resolx_LF" ,"RecHit resol(x) coord. (local frame)"); + if (layerswitchResolx_LF) { + simplehitsMEs.meResolxLF = + bookME1D(ibooker, "TH1Resolx_LF", "TH1Resolx_LF", "RecHit resol(x) coord. (local frame)"); simplehitsMEs.meResolxLF->setAxisTitle("resol(x) RecHit coord. (local frame)"); } - if(layerswitchResolx_MF) { - simplehitsMEs.meResolxMF = bookME1D(ibooker,"TH1Resolx_MF", "TH1Resolx_MF" ,"RecHit resol(x) coord. (measurement frame)"); + if (layerswitchResolx_MF) { + simplehitsMEs.meResolxMF = + bookME1D(ibooker, "TH1Resolx_MF", "TH1Resolx_MF", "RecHit resol(x) coord. (measurement frame)"); simplehitsMEs.meResolxMF->setAxisTitle("resol(x) RecHit coord. (measurement frame)"); } - if(layerswitchRes_LF) { - simplehitsMEs.meResLF = bookME1D(ibooker,"TH1Res_LF", "TH1Res_LF" ,"Residual of the hit x coordinate (local frame)"); + if (layerswitchRes_LF) { + simplehitsMEs.meResLF = + bookME1D(ibooker, "TH1Res_LF", "TH1Res_LF", "Residual of the hit x coordinate (local frame)"); simplehitsMEs.meResLF->setAxisTitle("Hit Res(x) (local frame)"); } - if(layerswitchRes_MF) { - simplehitsMEs.meResMF = bookME1D(ibooker,"TH1Res_MF", "TH1Res_MF" ,"Residual of the hit x coordinate (measurement frame)"); + if (layerswitchRes_MF) { + simplehitsMEs.meResMF = + bookME1D(ibooker, "TH1Res_MF", "TH1Res_MF", "Residual of the hit x coordinate (measurement frame)"); simplehitsMEs.meResMF->setAxisTitle("Hit Res(x) (measurement frame)"); } - if(layerswitchPull_LF) { - simplehitsMEs.mePullLF = bookME1D(ibooker,"TH1Pull_LF", "TH1Pull_LF" ,"Pull distribution (local frame)"); + if (layerswitchPull_LF) { + simplehitsMEs.mePullLF = bookME1D(ibooker, "TH1Pull_LF", "TH1Pull_LF", "Pull distribution (local frame)"); simplehitsMEs.mePullLF->setAxisTitle("Pull distribution (local frame)"); - } - if(layerswitchPull_MF) { - simplehitsMEs.mePullMF = bookME1D(ibooker,"TH1Pull_MF", "TH1Pull_MF" ,"Pull distribution (measurement frame)"); + } + if (layerswitchPull_MF) { + simplehitsMEs.mePullMF = bookME1D(ibooker, "TH1Pull_MF", "TH1Pull_MF", "Pull distribution (measurement frame)"); simplehitsMEs.mePullMF->setAxisTitle("Pull distribution (measurement frame)"); } - if(layerswitchCategory) { - simplehitsMEs.meCategory = bookME1D(ibooker,"TH1Category", "TH1Category" ,"Category"); + if (layerswitchCategory) { + simplehitsMEs.meCategory = bookME1D(ibooker, "TH1Category", "TH1Category", "Category"); simplehitsMEs.meCategory->setAxisTitle("Category"); - } - if(layerswitchTrackwidth) { - simplehitsMEs.meTrackwidth = bookME1D(ibooker,"TH1Trackwidth", "TH1Trackwidth" ,"Track width"); + } + if (layerswitchTrackwidth) { + simplehitsMEs.meTrackwidth = bookME1D(ibooker, "TH1Trackwidth", "TH1Trackwidth", "Track width"); simplehitsMEs.meTrackwidth->setAxisTitle("Track width"); } - if(layerswitchExpectedwidth) { - simplehitsMEs.meExpectedwidth = bookME1D(ibooker,"TH1Expectedwidth", "TH1Expectedwidth" ,"Expected width"); + if (layerswitchExpectedwidth) { + simplehitsMEs.meExpectedwidth = bookME1D(ibooker, "TH1Expectedwidth", "TH1Expectedwidth", "Expected width"); simplehitsMEs.meExpectedwidth->setAxisTitle("Expected width"); } - if(layerswitchClusterwidth) { - simplehitsMEs.meClusterwidth = bookME1D(ibooker,"TH1Clusterwidth", "TH1Clusterwidth" ,"Cluster width"); + if (layerswitchClusterwidth) { + simplehitsMEs.meClusterwidth = bookME1D(ibooker, "TH1Clusterwidth", "TH1Clusterwidth", "Cluster width"); simplehitsMEs.meClusterwidth->setAxisTitle("Cluster width"); - } - if(layerswitchTrackanglealpha) { - simplehitsMEs.meTrackanglealpha = bookME1D(ibooker,"TH1Trackanglealpha", "TH1Trackanglealpha" ,"Track angle alpha"); + } + if (layerswitchTrackanglealpha) { + simplehitsMEs.meTrackanglealpha = + bookME1D(ibooker, "TH1Trackanglealpha", "TH1Trackanglealpha", "Track angle alpha"); simplehitsMEs.meTrackanglealpha->setAxisTitle("Track angle alpha"); - } - if(layerswitchTrackanglebeta) { - simplehitsMEs.meTrackanglebeta = bookME1D(ibooker,"TH1Trackanglebeta", "TH1Trackanglebeta" ,"Track angle beta"); + } + if (layerswitchTrackanglebeta) { + simplehitsMEs.meTrackanglebeta = bookME1D(ibooker, "TH1Trackanglebeta", "TH1Trackanglebeta", "Track angle beta"); simplehitsMEs.meTrackanglebeta->setAxisTitle("Track angle beta"); - } - if(layerswitchResolxMFTrackwidthProfile_WClus1) { - simplehitsMEs.meResolxMFTrackwidthProfileWClus1 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_WClus1","TProfResolxMFTrackwidthProfile_WClus1","Profile of Resolution in MF vs track width for w=1"); - simplehitsMEs.meResolxMFTrackwidthProfileWClus1->setAxisTitle("Track width",1); - simplehitsMEs.meResolxMFTrackwidthProfileWClus1->setAxisTitle("Resolution (measurement frame) w=1",2); - } - if(layerswitchResolxMFTrackwidthProfile_WClus2) { - simplehitsMEs.meResolxMFTrackwidthProfileWClus2 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_WClus2","TProfResolxMFTrackwidthProfile_WClus2","Profile of Resolution in MF vs track width for w=2"); - simplehitsMEs.meResolxMFTrackwidthProfileWClus2->setAxisTitle("Track width",1); - simplehitsMEs.meResolxMFTrackwidthProfileWClus2->setAxisTitle("Resolution (measurement frame) w=2",2); - - } - if(layerswitchResolxMFTrackwidthProfile_WClus3) { - simplehitsMEs.meResolxMFTrackwidthProfileWClus3 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_WClus3","TProfResolxMFTrackwidthProfile_WClus3","Profile of Resolution in MF vs track width for w=3"); - simplehitsMEs.meResolxMFTrackwidthProfileWClus3->setAxisTitle("Track width",1); - simplehitsMEs.meResolxMFTrackwidthProfileWClus3->setAxisTitle("Resolution (measurement frame) w=3",2); - } - if(layerswitchResolxMFTrackwidthProfile_WClus4) { - simplehitsMEs.meResolxMFTrackwidthProfileWClus4 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_WClus4","TProfResolxMFTrackwidthProfile_WClus4","Profile of Resolution in MF vs track width for w=4"); - simplehitsMEs.meResolxMFTrackwidthProfileWClus4->setAxisTitle("Track width",1); - simplehitsMEs.meResolxMFTrackwidthProfileWClus4->setAxisTitle("Resolution (measurement frame) w=3",2); - } - if(layerswitchResMFTrackwidthProfile_WClus1) { - simplehitsMEs.meResMFTrackwidthProfileWClus1 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus1","TProfResMFTrackwidthProfile_WClus1","Profile of Residuals(x) in MF vs track width for w=1"); - simplehitsMEs.meResMFTrackwidthProfileWClus1->setAxisTitle("Track width",1); - simplehitsMEs.meResMFTrackwidthProfileWClus1->setAxisTitle("Residuals(x) (measurement frame) w=1",2); - } - if(layerswitchResMFTrackwidthProfile_WClus2) { - simplehitsMEs.meResMFTrackwidthProfileWClus2 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus2","TProfResMFTrackwidthProfile_WClus2","Profile of Residuals(x) in MF vs track width for w=2"); - simplehitsMEs.meResMFTrackwidthProfileWClus2->setAxisTitle("Track width",1); - simplehitsMEs.meResMFTrackwidthProfileWClus2->setAxisTitle("Residuals(x) (measurement frame) w=2",2); - } - if(layerswitchResMFTrackwidthProfile_WClus21) { - simplehitsMEs.meResMFTrackwidthProfileWClus21 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus21","TProfResMFTrackwidthProfile_WClus21","Profile of Residuals(x) in MF vs track width for w=2"); - simplehitsMEs.meResMFTrackwidthProfileWClus21->setAxisTitle("Track width",1); - simplehitsMEs.meResMFTrackwidthProfileWClus21->setAxisTitle("Residuals(x) (measurement frame) w=2",2); - } - if(layerswitchResMFTrackwidthProfile_WClus22) { - simplehitsMEs.meResMFTrackwidthProfileWClus22 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus22","TProfResMFTrackwidthProfile_WClus22","Profile of Residuals(x) in MF vs track width for w=2"); - simplehitsMEs.meResMFTrackwidthProfileWClus22->setAxisTitle("Track width",1); - simplehitsMEs.meResMFTrackwidthProfileWClus22->setAxisTitle("Residuals(x) (measurement frame) w=2",2); - - } - if(layerswitchResMFTrackwidthProfile_WClus23) { - simplehitsMEs.meResMFTrackwidthProfileWClus23 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus23","TProfResMFTrackwidthProfile_WClus23","Profile of Residuals(x) in MF vs track width for w=2"); - simplehitsMEs.meResMFTrackwidthProfileWClus23->setAxisTitle("Track width",1); - simplehitsMEs.meResMFTrackwidthProfileWClus23->setAxisTitle("Residuals(x) (measurement frame) w=2",2); - } - if(layerswitchResMFTrackwidthProfile_WClus3) { - simplehitsMEs.meResMFTrackwidthProfileWClus3 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus3","TProfResMFTrackwidthProfile_WClus3","Profile of Residuals(x) in MF vs track width for w=3"); - simplehitsMEs.meResMFTrackwidthProfileWClus3->setAxisTitle("Track width",1); - simplehitsMEs.meResMFTrackwidthProfileWClus3->setAxisTitle("Residuals(x) (measurement frame) w=3",2); - } - if(layerswitchResMFTrackwidthProfile_WClus4) { - simplehitsMEs.meResMFTrackwidthProfileWClus4 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus4","TProfResMFTrackwidthProfile_WClus4","Profile of Residuals(x) in MF vs track width for w=4"); - simplehitsMEs.meResMFTrackwidthProfileWClus4->setAxisTitle("Track width",1); - simplehitsMEs.meResMFTrackwidthProfileWClus4->setAxisTitle("Residuals(x) (measurement frame) w=4",2); - } - if(layerswitchResolxMFTrackwidthProfile) { - simplehitsMEs.meResolxMFTrackwidthProfile = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile","TProfResolxMFTrackwidthProfile","Profile of Resolution in MF vs track width"); - simplehitsMEs.meResolxMFTrackwidthProfile->setAxisTitle("Track width",1); - simplehitsMEs.meResolxMFTrackwidthProfile->setAxisTitle("Resolution (measurement frame)",2); - } - if(layerswitchResolxMFTrackwidthProfile_Category1) { - simplehitsMEs.meResolxMFTrackwidthProfileCategory1 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_Category1","TProfResolxMFTrackwidthProfile_Category1","Profile of Resolution in MF vs track width (Category 1)"); - simplehitsMEs.meResolxMFTrackwidthProfileCategory1->setAxisTitle("Track width",1); - simplehitsMEs.meResolxMFTrackwidthProfileCategory1->setAxisTitle("Resolution (measurement frame) Category 1",2); - } - if(layerswitchResolxMFTrackwidthProfile_Category2) { - simplehitsMEs.meResolxMFTrackwidthProfileCategory2 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_Category2","TProfResolxMFTrackwidthProfile_Category2","Profile of Resolution in MF vs track width (Category 2)"); - simplehitsMEs.meResolxMFTrackwidthProfileCategory2->setAxisTitle("Track width",1); - simplehitsMEs.meResolxMFTrackwidthProfileCategory2->setAxisTitle("Resolution (measurement frame) Category 2",2); - } - if(layerswitchResolxMFTrackwidthProfile_Category3) { - simplehitsMEs.meResolxMFTrackwidthProfileCategory3 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_Category3","TProfResolxMFTrackwidthProfile_Category3","Profile of Resolution in MF vs track width (Category 3)"); - simplehitsMEs.meResolxMFTrackwidthProfileCategory3->setAxisTitle("Track width",1); - simplehitsMEs.meResolxMFTrackwidthProfileCategory3->setAxisTitle("Resolution (measurement frame) Category 3",2); - } - if(layerswitchResolxMFTrackwidthProfile_Category4) { - simplehitsMEs.meResolxMFTrackwidthProfileCategory4 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_Category4","TProfResolxMFTrackwidthProfile_Category4","Profile of Resolution in MF vs track width (Category 4)"); - simplehitsMEs.meResolxMFTrackwidthProfileCategory4->setAxisTitle("Track width",1); - simplehitsMEs.meResolxMFTrackwidthProfileCategory4->setAxisTitle("Resolution (measurement frame) Category 4",2); - } - if(layerswitchResolxMFClusterwidthProfile_Category1) { - simplehitsMEs.meResolxMFClusterwidthProfileCategory1 = bookMEProfile(ibooker,"TProfResolxMFClusterwidthProfile_Category1","TProfResolxMFClusterwidthProfile_Category1","Profile of Resolution in MF vs cluster width (Category 1)"); - simplehitsMEs.meResolxMFClusterwidthProfileCategory1->setAxisTitle("Cluster width",1); - simplehitsMEs.meResolxMFClusterwidthProfileCategory1->setAxisTitle("Resolution (measurement frame) Category 1",2); - } - if(layerswitchResolxMFAngleProfile) { - simplehitsMEs.meResolxMFAngleProfile = bookMEProfile(ibooker,"TProfResolxMFAngleProfile","TProfResolxMFAngleProfile","Profile of Resolution in MF vs Track angle alpha"); - simplehitsMEs.meResolxMFAngleProfile->setAxisTitle("Track angle alpha",1); - simplehitsMEs.meResolxMFAngleProfile->setAxisTitle("Resolution (measurement frame)",2); - } - - + } + if (layerswitchResolxMFTrackwidthProfile_WClus1) { + simplehitsMEs.meResolxMFTrackwidthProfileWClus1 = + bookMEProfile(ibooker, + "TProfResolxMFTrackwidthProfile_WClus1", + "TProfResolxMFTrackwidthProfile_WClus1", + "Profile of Resolution in MF vs track width for w=1"); + simplehitsMEs.meResolxMFTrackwidthProfileWClus1->setAxisTitle("Track width", 1); + simplehitsMEs.meResolxMFTrackwidthProfileWClus1->setAxisTitle("Resolution (measurement frame) w=1", 2); + } + if (layerswitchResolxMFTrackwidthProfile_WClus2) { + simplehitsMEs.meResolxMFTrackwidthProfileWClus2 = + bookMEProfile(ibooker, + "TProfResolxMFTrackwidthProfile_WClus2", + "TProfResolxMFTrackwidthProfile_WClus2", + "Profile of Resolution in MF vs track width for w=2"); + simplehitsMEs.meResolxMFTrackwidthProfileWClus2->setAxisTitle("Track width", 1); + simplehitsMEs.meResolxMFTrackwidthProfileWClus2->setAxisTitle("Resolution (measurement frame) w=2", 2); + } + if (layerswitchResolxMFTrackwidthProfile_WClus3) { + simplehitsMEs.meResolxMFTrackwidthProfileWClus3 = + bookMEProfile(ibooker, + "TProfResolxMFTrackwidthProfile_WClus3", + "TProfResolxMFTrackwidthProfile_WClus3", + "Profile of Resolution in MF vs track width for w=3"); + simplehitsMEs.meResolxMFTrackwidthProfileWClus3->setAxisTitle("Track width", 1); + simplehitsMEs.meResolxMFTrackwidthProfileWClus3->setAxisTitle("Resolution (measurement frame) w=3", 2); + } + if (layerswitchResolxMFTrackwidthProfile_WClus4) { + simplehitsMEs.meResolxMFTrackwidthProfileWClus4 = + bookMEProfile(ibooker, + "TProfResolxMFTrackwidthProfile_WClus4", + "TProfResolxMFTrackwidthProfile_WClus4", + "Profile of Resolution in MF vs track width for w=4"); + simplehitsMEs.meResolxMFTrackwidthProfileWClus4->setAxisTitle("Track width", 1); + simplehitsMEs.meResolxMFTrackwidthProfileWClus4->setAxisTitle("Resolution (measurement frame) w=3", 2); + } + if (layerswitchResMFTrackwidthProfile_WClus1) { + simplehitsMEs.meResMFTrackwidthProfileWClus1 = + bookMEProfile(ibooker, + "TProfResMFTrackwidthProfile_WClus1", + "TProfResMFTrackwidthProfile_WClus1", + "Profile of Residuals(x) in MF vs track width for w=1"); + simplehitsMEs.meResMFTrackwidthProfileWClus1->setAxisTitle("Track width", 1); + simplehitsMEs.meResMFTrackwidthProfileWClus1->setAxisTitle("Residuals(x) (measurement frame) w=1", 2); + } + if (layerswitchResMFTrackwidthProfile_WClus2) { + simplehitsMEs.meResMFTrackwidthProfileWClus2 = + bookMEProfile(ibooker, + "TProfResMFTrackwidthProfile_WClus2", + "TProfResMFTrackwidthProfile_WClus2", + "Profile of Residuals(x) in MF vs track width for w=2"); + simplehitsMEs.meResMFTrackwidthProfileWClus2->setAxisTitle("Track width", 1); + simplehitsMEs.meResMFTrackwidthProfileWClus2->setAxisTitle("Residuals(x) (measurement frame) w=2", 2); + } + if (layerswitchResMFTrackwidthProfile_WClus21) { + simplehitsMEs.meResMFTrackwidthProfileWClus21 = + bookMEProfile(ibooker, + "TProfResMFTrackwidthProfile_WClus21", + "TProfResMFTrackwidthProfile_WClus21", + "Profile of Residuals(x) in MF vs track width for w=2"); + simplehitsMEs.meResMFTrackwidthProfileWClus21->setAxisTitle("Track width", 1); + simplehitsMEs.meResMFTrackwidthProfileWClus21->setAxisTitle("Residuals(x) (measurement frame) w=2", 2); + } + if (layerswitchResMFTrackwidthProfile_WClus22) { + simplehitsMEs.meResMFTrackwidthProfileWClus22 = + bookMEProfile(ibooker, + "TProfResMFTrackwidthProfile_WClus22", + "TProfResMFTrackwidthProfile_WClus22", + "Profile of Residuals(x) in MF vs track width for w=2"); + simplehitsMEs.meResMFTrackwidthProfileWClus22->setAxisTitle("Track width", 1); + simplehitsMEs.meResMFTrackwidthProfileWClus22->setAxisTitle("Residuals(x) (measurement frame) w=2", 2); + } + if (layerswitchResMFTrackwidthProfile_WClus23) { + simplehitsMEs.meResMFTrackwidthProfileWClus23 = + bookMEProfile(ibooker, + "TProfResMFTrackwidthProfile_WClus23", + "TProfResMFTrackwidthProfile_WClus23", + "Profile of Residuals(x) in MF vs track width for w=2"); + simplehitsMEs.meResMFTrackwidthProfileWClus23->setAxisTitle("Track width", 1); + simplehitsMEs.meResMFTrackwidthProfileWClus23->setAxisTitle("Residuals(x) (measurement frame) w=2", 2); + } + if (layerswitchResMFTrackwidthProfile_WClus3) { + simplehitsMEs.meResMFTrackwidthProfileWClus3 = + bookMEProfile(ibooker, + "TProfResMFTrackwidthProfile_WClus3", + "TProfResMFTrackwidthProfile_WClus3", + "Profile of Residuals(x) in MF vs track width for w=3"); + simplehitsMEs.meResMFTrackwidthProfileWClus3->setAxisTitle("Track width", 1); + simplehitsMEs.meResMFTrackwidthProfileWClus3->setAxisTitle("Residuals(x) (measurement frame) w=3", 2); + } + if (layerswitchResMFTrackwidthProfile_WClus4) { + simplehitsMEs.meResMFTrackwidthProfileWClus4 = + bookMEProfile(ibooker, + "TProfResMFTrackwidthProfile_WClus4", + "TProfResMFTrackwidthProfile_WClus4", + "Profile of Residuals(x) in MF vs track width for w=4"); + simplehitsMEs.meResMFTrackwidthProfileWClus4->setAxisTitle("Track width", 1); + simplehitsMEs.meResMFTrackwidthProfileWClus4->setAxisTitle("Residuals(x) (measurement frame) w=4", 2); + } + if (layerswitchResolxMFTrackwidthProfile) { + simplehitsMEs.meResolxMFTrackwidthProfile = bookMEProfile(ibooker, + "TProfResolxMFTrackwidthProfile", + "TProfResolxMFTrackwidthProfile", + "Profile of Resolution in MF vs track width"); + simplehitsMEs.meResolxMFTrackwidthProfile->setAxisTitle("Track width", 1); + simplehitsMEs.meResolxMFTrackwidthProfile->setAxisTitle("Resolution (measurement frame)", 2); + } + if (layerswitchResolxMFTrackwidthProfile_Category1) { + simplehitsMEs.meResolxMFTrackwidthProfileCategory1 = + bookMEProfile(ibooker, + "TProfResolxMFTrackwidthProfile_Category1", + "TProfResolxMFTrackwidthProfile_Category1", + "Profile of Resolution in MF vs track width (Category 1)"); + simplehitsMEs.meResolxMFTrackwidthProfileCategory1->setAxisTitle("Track width", 1); + simplehitsMEs.meResolxMFTrackwidthProfileCategory1->setAxisTitle("Resolution (measurement frame) Category 1", 2); + } + if (layerswitchResolxMFTrackwidthProfile_Category2) { + simplehitsMEs.meResolxMFTrackwidthProfileCategory2 = + bookMEProfile(ibooker, + "TProfResolxMFTrackwidthProfile_Category2", + "TProfResolxMFTrackwidthProfile_Category2", + "Profile of Resolution in MF vs track width (Category 2)"); + simplehitsMEs.meResolxMFTrackwidthProfileCategory2->setAxisTitle("Track width", 1); + simplehitsMEs.meResolxMFTrackwidthProfileCategory2->setAxisTitle("Resolution (measurement frame) Category 2", 2); + } + if (layerswitchResolxMFTrackwidthProfile_Category3) { + simplehitsMEs.meResolxMFTrackwidthProfileCategory3 = + bookMEProfile(ibooker, + "TProfResolxMFTrackwidthProfile_Category3", + "TProfResolxMFTrackwidthProfile_Category3", + "Profile of Resolution in MF vs track width (Category 3)"); + simplehitsMEs.meResolxMFTrackwidthProfileCategory3->setAxisTitle("Track width", 1); + simplehitsMEs.meResolxMFTrackwidthProfileCategory3->setAxisTitle("Resolution (measurement frame) Category 3", 2); + } + if (layerswitchResolxMFTrackwidthProfile_Category4) { + simplehitsMEs.meResolxMFTrackwidthProfileCategory4 = + bookMEProfile(ibooker, + "TProfResolxMFTrackwidthProfile_Category4", + "TProfResolxMFTrackwidthProfile_Category4", + "Profile of Resolution in MF vs track width (Category 4)"); + simplehitsMEs.meResolxMFTrackwidthProfileCategory4->setAxisTitle("Track width", 1); + simplehitsMEs.meResolxMFTrackwidthProfileCategory4->setAxisTitle("Resolution (measurement frame) Category 4", 2); + } + if (layerswitchResolxMFClusterwidthProfile_Category1) { + simplehitsMEs.meResolxMFClusterwidthProfileCategory1 = + bookMEProfile(ibooker, + "TProfResolxMFClusterwidthProfile_Category1", + "TProfResolxMFClusterwidthProfile_Category1", + "Profile of Resolution in MF vs cluster width (Category 1)"); + simplehitsMEs.meResolxMFClusterwidthProfileCategory1->setAxisTitle("Cluster width", 1); + simplehitsMEs.meResolxMFClusterwidthProfileCategory1->setAxisTitle("Resolution (measurement frame) Category 1", 2); + } + if (layerswitchResolxMFAngleProfile) { + simplehitsMEs.meResolxMFAngleProfile = bookMEProfile(ibooker, + "TProfResolxMFAngleProfile", + "TProfResolxMFAngleProfile", + "Profile of Resolution in MF vs Track angle alpha"); + simplehitsMEs.meResolxMFAngleProfile->setAxisTitle("Track angle alpha", 1); + simplehitsMEs.meResolxMFAngleProfile->setAxisTitle("Resolution (measurement frame)", 2); + } } //------------------------------------------------------------------------------------------ -void SiStripTrackingRecHitsValid::createLayerMEs(DQMStore::IBooker & ibooker,std::string label) -{ +void SiStripTrackingRecHitsValid::createLayerMEs(DQMStore::IBooker &ibooker, std::string label) { SiStripHistoId hidmanager; - LayerMEs layerMEs; + LayerMEs layerMEs; layerMEs.meWclusRphi = nullptr; layerMEs.meAdcRphi = nullptr; @@ -1562,300 +1824,506 @@ void SiStripTrackingRecHitsValid::createLayerMEs(DQMStore::IBooker & ibooker,std layerMEs.merapidityResProfilewclus2 = nullptr; layerMEs.merapidityResProfilewclus3 = nullptr; layerMEs.merapidityResProfilewclus4 = nullptr; - //WclusRphi - if(layerswitchWclusRphi) { - layerMEs.meWclusRphi = bookME1D(ibooker,"TH1WclusRphi", hidmanager.createHistoLayer("Wclus_rphi","layer",label,"").c_str() ,"Cluster Width - Number of strips that belong to the RecHit cluster"); - layerMEs.meWclusRphi->setAxisTitle("Cluster Width [nr strips] in "+ label); + if (layerswitchWclusRphi) { + layerMEs.meWclusRphi = bookME1D(ibooker, + "TH1WclusRphi", + hidmanager.createHistoLayer("Wclus_rphi", "layer", label, "").c_str(), + "Cluster Width - Number of strips that belong to the RecHit cluster"); + layerMEs.meWclusRphi->setAxisTitle("Cluster Width [nr strips] in " + label); } //AdcRphi - if(layerswitchAdcRphi) { - layerMEs.meAdcRphi = bookME1D(ibooker,"TH1AdcRphi", hidmanager.createHistoLayer("Adc_rphi","layer",label,"").c_str() ,"RecHit Cluster Charge"); + if (layerswitchAdcRphi) { + layerMEs.meAdcRphi = bookME1D(ibooker, + "TH1AdcRphi", + hidmanager.createHistoLayer("Adc_rphi", "layer", label, "").c_str(), + "RecHit Cluster Charge"); layerMEs.meAdcRphi->setAxisTitle("cluster charge [ADC] in " + label); } //ResolxLFRphi - if(layerswitchResolxLFRphi) { - layerMEs.meResolxLFRphi = bookME1D(ibooker,"TH1ResolxLFRphi", hidmanager.createHistoLayer("Resolx_LF_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord."); //~20micron + if (layerswitchResolxLFRphi) { + layerMEs.meResolxLFRphi = bookME1D(ibooker, + "TH1ResolxLFRphi", + hidmanager.createHistoLayer("Resolx_LF_rphi", "layer", label, "").c_str(), + "RecHit resol(x) coord."); //~20micron layerMEs.meResolxLFRphi->setAxisTitle("resol(x) RecHit coord. (local frame) in " + label); } //ResolxMFRphi - if(layerswitchResolxMFRphi) { - layerMEs.meResolxMFRphi = bookME1D(ibooker,"TH1ResolxMFRphi", hidmanager.createHistoLayer("Resolx_MF_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord."); //~20micron + if (layerswitchResolxMFRphi) { + layerMEs.meResolxMFRphi = bookME1D(ibooker, + "TH1ResolxMFRphi", + hidmanager.createHistoLayer("Resolx_MF_rphi", "layer", label, "").c_str(), + "RecHit resol(x) coord."); //~20micron layerMEs.meResolxMFRphi->setAxisTitle("resol(x) RecHit coord. (measurement frame) in " + label); } //ResolxMFRphiwclus1 - if(layerswitchResolxMFRphiwclus1) { - layerMEs.meResolxMFRphiwclus1 = bookME1D(ibooker,"TH1ResolxMFRphiwclus1", hidmanager.createHistoLayer("Resolx_MF_wclus1_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord. w=1 "); //~20micron + if (layerswitchResolxMFRphiwclus1) { + layerMEs.meResolxMFRphiwclus1 = + bookME1D(ibooker, + "TH1ResolxMFRphiwclus1", + hidmanager.createHistoLayer("Resolx_MF_wclus1_rphi", "layer", label, "").c_str(), + "RecHit resol(x) coord. w=1 "); //~20micron layerMEs.meResolxMFRphiwclus1->setAxisTitle("resol(x) RecHit coord. (measurement frame) for w=1 in " + label); } //ResolxMFRphiwclus2 - if(layerswitchResolxMFRphiwclus2) { - layerMEs.meResolxMFRphiwclus2 = bookME1D(ibooker,"TH1ResolxMFRphiwclus2", hidmanager.createHistoLayer("Resolx_MF_wclus2_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord. w=2 "); //~20micron + if (layerswitchResolxMFRphiwclus2) { + layerMEs.meResolxMFRphiwclus2 = + bookME1D(ibooker, + "TH1ResolxMFRphiwclus2", + hidmanager.createHistoLayer("Resolx_MF_wclus2_rphi", "layer", label, "").c_str(), + "RecHit resol(x) coord. w=2 "); //~20micron layerMEs.meResolxMFRphiwclus2->setAxisTitle("resol(x) RecHit coord. (measurement frame) for w=2 in " + label); } //ResolxMFRphiwclus3 - if(layerswitchResolxMFRphiwclus3) { - layerMEs.meResolxMFRphiwclus3 = bookME1D(ibooker,"TH1ResolxMFRphiwclus3", hidmanager.createHistoLayer("Resolx_MF_wclus3_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord. w=3 "); //~20micron + if (layerswitchResolxMFRphiwclus3) { + layerMEs.meResolxMFRphiwclus3 = + bookME1D(ibooker, + "TH1ResolxMFRphiwclus3", + hidmanager.createHistoLayer("Resolx_MF_wclus3_rphi", "layer", label, "").c_str(), + "RecHit resol(x) coord. w=3 "); //~20micron layerMEs.meResolxMFRphiwclus3->setAxisTitle("resol(x) RecHit coord. (measurement frame) for w=3 in " + label); } //ResolxMFRphiwclus4 - if(layerswitchResolxMFRphiwclus4) { - layerMEs.meResolxMFRphiwclus4 = bookME1D(ibooker,"TH1ResolxMFRphiwclus4", hidmanager.createHistoLayer("Resolx_MF_wclus4_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord. w=4 "); //~20micron + if (layerswitchResolxMFRphiwclus4) { + layerMEs.meResolxMFRphiwclus4 = + bookME1D(ibooker, + "TH1ResolxMFRphiwclus4", + hidmanager.createHistoLayer("Resolx_MF_wclus4_rphi", "layer", label, "").c_str(), + "RecHit resol(x) coord. w=4 "); //~20micron layerMEs.meResolxMFRphiwclus4->setAxisTitle("resol(x) RecHit coord. (measurement frame) for w=4 in " + label); } //ResLFRphi - if(layerswitchResLFRphi) { - layerMEs.meResLFRphi = bookME1D(ibooker,"TH1ResLFRphi", hidmanager.createHistoLayer("Res_LF_rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate"); + if (layerswitchResLFRphi) { + layerMEs.meResLFRphi = bookME1D(ibooker, + "TH1ResLFRphi", + hidmanager.createHistoLayer("Res_LF_rphi", "layer", label, "").c_str(), + "Residual of the hit x coordinate"); layerMEs.meResLFRphi->setAxisTitle("Hit Residuals(x) (local frame) in " + label); } //ResMFRphi - if(layerswitchResMFRphi) { - layerMEs.meResMFRphi = bookME1D(ibooker,"TH1ResMFRphi",hidmanager.createHistoLayer("Res_MF_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate"); - layerMEs.meResMFRphi->setAxisTitle("Hit Residuals(x) (measurement frame) in "+ label); + if (layerswitchResMFRphi) { + layerMEs.meResMFRphi = bookME1D(ibooker, + "TH1ResMFRphi", + hidmanager.createHistoLayer("Res_MF_Rphi", "layer", label, "").c_str(), + "Residual of the hit x coordinate"); + layerMEs.meResMFRphi->setAxisTitle("Hit Residuals(x) (measurement frame) in " + label); } //ResMFRphiwclus1 - if(layerswitchResMFRphiwclus1) { - layerMEs.meResMFRphiwclus1 = bookME1D(ibooker,"TH1ResMFRphiwclus1",hidmanager.createHistoLayer("Res_MF_wclus1_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate w=1"); - layerMEs.meResMFRphiwclus1->setAxisTitle("Hit Residuals(x) (measurement frame) for w=1 in "+ label); + if (layerswitchResMFRphiwclus1) { + layerMEs.meResMFRphiwclus1 = bookME1D(ibooker, + "TH1ResMFRphiwclus1", + hidmanager.createHistoLayer("Res_MF_wclus1_Rphi", "layer", label, "").c_str(), + "Residual of the hit x coordinate w=1"); + layerMEs.meResMFRphiwclus1->setAxisTitle("Hit Residuals(x) (measurement frame) for w=1 in " + label); } //ResMFRphiwclus2 - if(layerswitchResMFRphiwclus2) { - layerMEs.meResMFRphiwclus2 = bookME1D(ibooker,"TH1ResMFRphiwclus2",hidmanager.createHistoLayer("Res_MF_wclus2_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate w=2"); - layerMEs.meResMFRphiwclus2->setAxisTitle("Hit Residuals(x) (measurement frame) for w=2 in "+ label); + if (layerswitchResMFRphiwclus2) { + layerMEs.meResMFRphiwclus2 = bookME1D(ibooker, + "TH1ResMFRphiwclus2", + hidmanager.createHistoLayer("Res_MF_wclus2_Rphi", "layer", label, "").c_str(), + "Residual of the hit x coordinate w=2"); + layerMEs.meResMFRphiwclus2->setAxisTitle("Hit Residuals(x) (measurement frame) for w=2 in " + label); } //ResMFRphiwclus3 - if(layerswitchResMFRphiwclus3) { - layerMEs.meResMFRphiwclus3 = bookME1D(ibooker,"TH1ResMFRphiwclus3",hidmanager.createHistoLayer("Res_MF_wclus3_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate w=3"); - layerMEs.meResMFRphiwclus3->setAxisTitle("Hit Residuals(x) (measurement frame) for w=3 in "+ label); + if (layerswitchResMFRphiwclus3) { + layerMEs.meResMFRphiwclus3 = bookME1D(ibooker, + "TH1ResMFRphiwclus3", + hidmanager.createHistoLayer("Res_MF_wclus3_Rphi", "layer", label, "").c_str(), + "Residual of the hit x coordinate w=3"); + layerMEs.meResMFRphiwclus3->setAxisTitle("Hit Residuals(x) (measurement frame) for w=3 in " + label); } //ResMFRphiwclus4 - if(layerswitchResMFRphiwclus4) { - layerMEs.meResMFRphiwclus4 = bookME1D(ibooker,"TH1ResMFRphiwclus4",hidmanager.createHistoLayer("Res_MF_wclus4_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate w=4"); - layerMEs.meResMFRphiwclus4->setAxisTitle("Hit Residuals(x) (measurement frame) for w=4 in "+ label); + if (layerswitchResMFRphiwclus4) { + layerMEs.meResMFRphiwclus4 = bookME1D(ibooker, + "TH1ResMFRphiwclus4", + hidmanager.createHistoLayer("Res_MF_wclus4_Rphi", "layer", label, "").c_str(), + "Residual of the hit x coordinate w=4"); + layerMEs.meResMFRphiwclus4->setAxisTitle("Hit Residuals(x) (measurement frame) for w=4 in " + label); } //PullLFRphi - if(layerswitchPullLFRphi) { - layerMEs.mePullLFRphi = bookME1D(ibooker,"TH1PullLFRphi", hidmanager.createHistoLayer("Pull_LF_rphi","layer",label,"").c_str() ,"Pull distribution"); + if (layerswitchPullLFRphi) { + layerMEs.mePullLFRphi = bookME1D(ibooker, + "TH1PullLFRphi", + hidmanager.createHistoLayer("Pull_LF_rphi", "layer", label, "").c_str(), + "Pull distribution"); layerMEs.mePullLFRphi->setAxisTitle("Pull distribution (local frame) in " + label); } //PullMFRphi - if(layerswitchPullMFRphi) { - layerMEs.mePullMFRphi = bookME1D(ibooker,"TH1PullMFRphi", hidmanager.createHistoLayer("Pull_MF_rphi","layer",label,"").c_str() ,"Pull distribution"); + if (layerswitchPullMFRphi) { + layerMEs.mePullMFRphi = bookME1D(ibooker, + "TH1PullMFRphi", + hidmanager.createHistoLayer("Pull_MF_rphi", "layer", label, "").c_str(), + "Pull distribution"); layerMEs.mePullMFRphi->setAxisTitle("Pull distribution (measurement frame) in " + label); } //PullMFRphiwclus1 - if(layerswitchPullMFRphiwclus1) { - layerMEs.mePullMFRphiwclus1 = bookME1D(ibooker,"TH1PullMFRphiwclus1", hidmanager.createHistoLayer("Pull_MF_wclus1_rphi","layer",label,"").c_str() ,"Pull distribution w=1"); + if (layerswitchPullMFRphiwclus1) { + layerMEs.mePullMFRphiwclus1 = + bookME1D(ibooker, + "TH1PullMFRphiwclus1", + hidmanager.createHistoLayer("Pull_MF_wclus1_rphi", "layer", label, "").c_str(), + "Pull distribution w=1"); layerMEs.mePullMFRphiwclus1->setAxisTitle("Pull distribution (measurement frame) for w=1 in " + label); } //PullMFRphiwclus2 - if(layerswitchPullMFRphiwclus2) { - layerMEs.mePullMFRphiwclus2 = bookME1D(ibooker,"TH1PullMFRphiwclus2", hidmanager.createHistoLayer("Pull_MF_wclus2_rphi","layer",label,"").c_str() ,"Pull distribution w=2"); + if (layerswitchPullMFRphiwclus2) { + layerMEs.mePullMFRphiwclus2 = + bookME1D(ibooker, + "TH1PullMFRphiwclus2", + hidmanager.createHistoLayer("Pull_MF_wclus2_rphi", "layer", label, "").c_str(), + "Pull distribution w=2"); layerMEs.mePullMFRphiwclus2->setAxisTitle("Pull distribution (measurement frame) for w=2 in " + label); } //PullMFRphiwclus3 - if(layerswitchPullMFRphiwclus3) { - layerMEs.mePullMFRphiwclus3 = bookME1D(ibooker,"TH1PullMFRphiwclus3", hidmanager.createHistoLayer("Pull_MF_wclus3_rphi","layer",label,"").c_str() ,"Pull distribution w=3"); + if (layerswitchPullMFRphiwclus3) { + layerMEs.mePullMFRphiwclus3 = + bookME1D(ibooker, + "TH1PullMFRphiwclus3", + hidmanager.createHistoLayer("Pull_MF_wclus3_rphi", "layer", label, "").c_str(), + "Pull distribution w=3"); layerMEs.mePullMFRphiwclus3->setAxisTitle("Pull distribution (measurement frame) for w=3 in " + label); } //PullMFRphiwclus4 - if(layerswitchPullMFRphiwclus4) { - layerMEs.mePullMFRphiwclus4 = bookME1D(ibooker,"TH1PullMFRphiwclus4", hidmanager.createHistoLayer("Pull_MF_wclus4_rphi","layer",label,"").c_str() ,"Pull distribution w=4"); + if (layerswitchPullMFRphiwclus4) { + layerMEs.mePullMFRphiwclus4 = + bookME1D(ibooker, + "TH1PullMFRphiwclus4", + hidmanager.createHistoLayer("Pull_MF_wclus4_rphi", "layer", label, "").c_str(), + "Pull distribution w=4"); layerMEs.mePullMFRphiwclus4->setAxisTitle("Pull distribution (measurement frame) for w=4 in " + label); } - if(layerswitchTrackangleRphi) { - layerMEs.meTrackangleRphi = bookME1D(ibooker,"TH1TrackangleRphi",hidmanager.createHistoLayer("Track_angle_Rphi","layer",label,"").c_str() ,"Track angle alpha"); - layerMEs.meTrackangleRphi->setAxisTitle("Track angle in "+ label); - } - if(layerswitchTrackanglebetaRphi) { - layerMEs.meTrackanglebetaRphi = bookME1D(ibooker,"TH1TrackanglebetaRphi",hidmanager.createHistoLayer("Track_angle_beta_Rphi","layer",label,"").c_str() ,"Track angle beta"); - layerMEs.meTrackanglebetaRphi->setAxisTitle(""+ label); - } - if(layerswitchTrackangle2Rphi) { - layerMEs.meTrackangle2Rphi = bookME1D(ibooker,"TH1Trackangle2Rphi",hidmanager.createHistoLayer("Track_angle2_Rphi","layer",label,"").c_str() ,""); - layerMEs.meTrackangle2Rphi->setAxisTitle(""+ label); - } - if(layerswitchPullTrackangleProfileRphi) { - layerMEs.mePullTrackangleProfileRphi = bookMEProfile(ibooker,"TProfPullTrackangleProfileRphi",hidmanager.createHistoLayer("Pull_Trackangle_Profile_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track angle alpha"); - layerMEs.mePullTrackangleProfileRphi->setAxisTitle("Track angle alpha in "+ label,1); - layerMEs.mePullTrackangleProfileRphi->setAxisTitle("Pull (MF) in "+ label,2); - } - if(layerswitchPullTrackangle2DRphi) { - layerMEs.mePullTrackangle2DRphi = bookME1D(ibooker,"TH1PullTrackangle2DRphi",hidmanager.createHistoLayer("Pull_Trackangle_2D_Rphi","layer",label,"").c_str() ,""); - layerMEs.mePullTrackangle2DRphi->setAxisTitle(""+ label); - } - if(layerswitchTrackwidthRphi) { - layerMEs.meTrackwidthRphi = bookME1D(ibooker,"TH1TrackwidthRphi",hidmanager.createHistoLayer("Track_width_Rphi","layer",label,"").c_str() ,"Track width"); - layerMEs.meTrackwidthRphi->setAxisTitle("Track width in "+ label); - } - if(layerswitchExpectedwidthRphi) { - layerMEs.meExpectedwidthRphi = bookME1D(ibooker,"TH1ExpectedwidthRphi",hidmanager.createHistoLayer("Expected_width_Rphi","layer",label,"").c_str() ,"Expected width"); - layerMEs.meExpectedwidthRphi->setAxisTitle("Expected width in "+ label); - } - if(layerswitchClusterwidthRphi) { - layerMEs.meClusterwidthRphi = bookME1D(ibooker,"TH1ClusterwidthRphi",hidmanager.createHistoLayer("Cluster_width_Rphi","layer",label,"").c_str() ,"Cluster width"); - layerMEs.meClusterwidthRphi->setAxisTitle("Cluster width in "+ label); - } - if(layerswitchCategoryRphi) { - layerMEs.meCategoryRphi = bookME1D(ibooker,"TH1CategoryRphi",hidmanager.createHistoLayer("Category_Rphi","layer",label,"").c_str() ,"Category"); - layerMEs.meCategoryRphi->setAxisTitle("Category in "+ label); - } - if(layerswitchPullTrackwidthProfileRphi) { - layerMEs.mePullTrackwidthProfileRphi = bookMEProfile(ibooker,"TProfPullTrackwidthProfileRphi",hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track width"); - layerMEs.mePullTrackwidthProfileRphi->setAxisTitle("track width in "+ label,1); - layerMEs.mePullTrackwidthProfileRphi->setAxisTitle("Pull (MF) in "+ label,2); - } - if(layerswitchPullTrackwidthProfileRphiwclus1) { - layerMEs.mePullTrackwidthProfileRphiwclus1 = bookMEProfile(ibooker,"TProfPullTrackwidthProfileRphiwclus1",hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi_wclus1","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for w=1"); - layerMEs.mePullTrackwidthProfileRphiwclus1->setAxisTitle("track width for w=1 in "+ label,1); - layerMEs.mePullTrackwidthProfileRphiwclus1->setAxisTitle("Pull (MF) for w=1 in "+ label,2); - } - if(layerswitchPullTrackwidthProfileRphiwclus2) { - layerMEs.mePullTrackwidthProfileRphiwclus2 = bookMEProfile(ibooker,"TProfPullTrackwidthProfileRphiwclus2",hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi_wclus2","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for w=2"); - layerMEs.mePullTrackwidthProfileRphiwclus2->setAxisTitle("track width for w=2 in "+ label,1); - layerMEs.mePullTrackwidthProfileRphiwclus2->setAxisTitle("Pull (MF) for w=2 in "+ label,2); - - } - if(layerswitchPullTrackwidthProfileRphiwclus3) { - layerMEs.mePullTrackwidthProfileRphiwclus3 = bookMEProfile(ibooker,"TProfPullTrackwidthProfileRphiwclus3",hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi_wclus3","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for w=3"); - layerMEs.mePullTrackwidthProfileRphiwclus3->setAxisTitle("track width for w=3 in "+ label,1); - layerMEs.mePullTrackwidthProfileRphiwclus3->setAxisTitle("Pull (MF) for w=3 in "+ label,2); - } - if(layerswitchPullTrackwidthProfileRphiwclus4) { - layerMEs.mePullTrackwidthProfileRphiwclus4 = bookMEProfile(ibooker,"TProfPullTrackwidthProfileRphiwclus4",hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi_wclus4","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for w=4"); - layerMEs.mePullTrackwidthProfileRphiwclus4->setAxisTitle("track width for w=4 in "+ label,1); - layerMEs.mePullTrackwidthProfileRphiwclus4->setAxisTitle("Pull (MF) for w=4 in "+ label,2); - - } - if(layerswitchPullTrackwidthProfileCategory1Rphi) { - layerMEs.mePullTrackwidthProfileCategory1Rphi = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory1Rphi",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category1_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for Category 1"); - layerMEs.mePullTrackwidthProfileCategory1Rphi->setAxisTitle("track width for Category 1 in "+ label,1); - layerMEs.mePullTrackwidthProfileCategory1Rphi->setAxisTitle("Pull (MF) for Category 1 in "+ label,2); - } - if(layerswitchPullTrackwidthProfileCategory2Rphi) { - layerMEs.mePullTrackwidthProfileCategory2Rphi = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory2Rphi",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category2_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for Category 2"); - layerMEs.mePullTrackwidthProfileCategory2Rphi->setAxisTitle("track width for Category 2 in "+ label,1); - layerMEs.mePullTrackwidthProfileCategory2Rphi->setAxisTitle("Pull (MF) for Category 2 in "+ label,2); - } - if(layerswitchPullTrackwidthProfileCategory3Rphi) { - layerMEs.mePullTrackwidthProfileCategory3Rphi = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory3Rphi",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category3_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for Category 3"); - layerMEs.mePullTrackwidthProfileCategory3Rphi->setAxisTitle("track width for Category 3 in "+ label,1); - layerMEs.mePullTrackwidthProfileCategory3Rphi->setAxisTitle("Pull (MF) for Category 3 in "+ label,2); - } - if(layerswitchPullTrackwidthProfileCategory4Rphi) { - layerMEs.mePullTrackwidthProfileCategory4Rphi = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory4Rphi",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category4_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for Category 4"); - layerMEs.mePullTrackwidthProfileCategory4Rphi->setAxisTitle("track width for Category 4 in "+ label,1); - layerMEs.mePullTrackwidthProfileCategory4Rphi->setAxisTitle("Pull (MF) for Category 4 in "+ label,2); - } - if(layerswitchResolxMFTrackwidthProfileRphi) { - layerMEs.meResolxMFTrackwidthProfileRphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileRphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width"); - layerMEs.meResolxMFTrackwidthProfileRphi->setAxisTitle("track width in "+ label,1); - layerMEs.meResolxMFTrackwidthProfileRphi->setAxisTitle("Resolution in MF in "+ label,2); - } - - if(layerswitchResolxMFTrackwidthProfileWclus1Rphi) { - layerMEs.meResolxMFTrackwidthProfileWclus1Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileWclus1Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Wclus1_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for w=1"); - layerMEs.meResolxMFTrackwidthProfileWclus1Rphi->setAxisTitle("track width for w=1 in "+ label,1); - layerMEs.meResolxMFTrackwidthProfileWclus1Rphi->setAxisTitle("Resolution in MF for w=1 in "+ label,2); - } - if(layerswitchResolxMFTrackwidthProfileWclus2Rphi) { - layerMEs.meResolxMFTrackwidthProfileWclus2Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileWclus2Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Wclus2_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for w=2"); - layerMEs.meResolxMFTrackwidthProfileWclus2Rphi->setAxisTitle("track width for w=2 in "+ label,1); - layerMEs.meResolxMFTrackwidthProfileWclus2Rphi->setAxisTitle("Resolution in MF for w=2 in "+ label,2); - } - if(layerswitchResolxMFTrackwidthProfileWclus3Rphi) { - layerMEs.meResolxMFTrackwidthProfileWclus3Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileWclus3Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Wclus3_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for w=3"); - layerMEs.meResolxMFTrackwidthProfileWclus3Rphi->setAxisTitle("track width for w=3 in "+ label,1); - layerMEs.meResolxMFTrackwidthProfileWclus3Rphi->setAxisTitle("Resolution in MF for w=3 in "+ label,2); - } - if(layerswitchResolxMFTrackwidthProfileWclus4Rphi) { - layerMEs.meResolxMFTrackwidthProfileWclus4Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileWclus4Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Wclus4_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for w=4"); - layerMEs.meResolxMFTrackwidthProfileWclus4Rphi->setAxisTitle("track width for w=4 in "+ label,1); - layerMEs.meResolxMFTrackwidthProfileWclus4Rphi->setAxisTitle("Resolution in MF for w=4 in "+ label,2); - } - if(layerswitchResMFTrackwidthProfileWclus1Rphi) { - layerMEs.meResMFTrackwidthProfileWclus1Rphi = bookMEProfile(ibooker,"TProfResMFTrackwidthProfileWclus1Rphi",hidmanager.createHistoLayer("ResMF_Track_width_Profile_Wclus1_Rphi","layer",label,"").c_str() ,"Profile of Residuals(x) in MF vs track width for w=1"); - layerMEs.meResMFTrackwidthProfileWclus1Rphi->setAxisTitle("track width for w=1 in "+ label,1); - layerMEs.meResMFTrackwidthProfileWclus1Rphi->setAxisTitle("Residuals(x) in MF for w=1 in "+ label,2); - } - if(layerswitchResMFTrackwidthProfileWclus2Rphi) { - layerMEs.meResMFTrackwidthProfileWclus2Rphi = bookMEProfile(ibooker,"TProfResMFTrackwidthProfileWclus2Rphi",hidmanager.createHistoLayer("ResMF_Track_width_Profile_Wclus2_Rphi","layer",label,"").c_str() ,"Profile of Residuals(x) in MF vs track width for w=2"); - layerMEs.meResMFTrackwidthProfileWclus2Rphi->setAxisTitle("track width for w=2 in "+ label,1); - layerMEs.meResMFTrackwidthProfileWclus2Rphi->setAxisTitle("Residuals(x) in MF for w=2 in "+ label,2); - } - if(layerswitchResMFTrackwidthProfileWclus3Rphi) { - layerMEs.meResMFTrackwidthProfileWclus3Rphi = bookMEProfile(ibooker,"TProfResMFTrackwidthProfileWclus3Rphi",hidmanager.createHistoLayer("ResMF_Track_width_Profile_Wclus3_Rphi","layer",label,"").c_str() ,"Profile of Residuals(x) in MF vs track width for w=3"); - layerMEs.meResMFTrackwidthProfileWclus3Rphi->setAxisTitle("track width for w=3 in "+ label,1); - layerMEs.meResMFTrackwidthProfileWclus3Rphi->setAxisTitle("Residuals(x) in MF for w=3 in "+ label,2); - } - if(layerswitchResMFTrackwidthProfileWclus4Rphi) { - layerMEs.meResMFTrackwidthProfileWclus4Rphi = bookMEProfile(ibooker,"TProfResMFTrackwidthProfileWclus4Rphi",hidmanager.createHistoLayer("ResMF_Track_width_Profile_Wclus4_Rphi","layer",label,"").c_str() ,"Profile of Residuals(x) in MF vs track width for w=4"); - layerMEs.meResMFTrackwidthProfileWclus4Rphi->setAxisTitle("track width for w=4 in "+ label,1); - layerMEs.meResMFTrackwidthProfileWclus4Rphi->setAxisTitle("Residuals(x) in MF for w=4 in "+ label,2); - } - - if(layerswitchResolxMFTrackwidthProfileCategory1Rphi) { - layerMEs.meResolxMFTrackwidthProfileCategory1Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory1Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category1_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for Category 1"); - layerMEs.meResolxMFTrackwidthProfileCategory1Rphi->setAxisTitle("track width for Category 1 in "+ label,1); - layerMEs.meResolxMFTrackwidthProfileCategory1Rphi->setAxisTitle("Resolution in MF for Category 1 in "+ label,2); - } - if(layerswitchResolxMFTrackwidthProfileCategory2Rphi) { - layerMEs.meResolxMFTrackwidthProfileCategory2Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory2Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category2_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for Category 2"); - layerMEs.meResolxMFTrackwidthProfileCategory2Rphi->setAxisTitle("track width for Category 2 in "+ label,1); - layerMEs.meResolxMFTrackwidthProfileCategory2Rphi->setAxisTitle("Resolution in MF for Category 2 in "+ label,2); - } - if(layerswitchResolxMFTrackwidthProfileCategory3Rphi) { - layerMEs.meResolxMFTrackwidthProfileCategory3Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory3Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category3_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for Category 3"); - layerMEs.meResolxMFTrackwidthProfileCategory3Rphi->setAxisTitle("track width for Category 3 in "+ label,1); - layerMEs.meResolxMFTrackwidthProfileCategory3Rphi->setAxisTitle("Resolution in MF for Category 3 in "+ label,2); - } - if(layerswitchResolxMFTrackwidthProfileCategory4Rphi) { - layerMEs.meResolxMFTrackwidthProfileCategory4Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory4Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category3_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for Category 4"); - layerMEs.meResolxMFTrackwidthProfileCategory4Rphi->setAxisTitle("track width for Category 4 in "+ label,1); - layerMEs.meResolxMFTrackwidthProfileCategory4Rphi->setAxisTitle("Resolution in MF for Category 4 in "+ label,2); - } - if(layerswitchResolxMFClusterwidthProfileCategory1Rphi) { - layerMEs.meResolxMFClusterwidthProfileCategory1Rphi = bookMEProfile(ibooker,"TProfResolxMFClusterwidthProfileCategory1Rphi",hidmanager.createHistoLayer("ResolxMF_Cluster_width_Profile_Category1_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs cluster width for Category 1"); - layerMEs.meResolxMFClusterwidthProfileCategory1Rphi->setAxisTitle("cluster width for Category 1 in "+ label,1); - layerMEs.meResolxMFClusterwidthProfileCategory1Rphi->setAxisTitle("Resolution in MF for Category 1 in "+ label,2); - } - if(layerswitchResolxMFAngleProfileRphi) { - layerMEs.meResolxMFAngleProfileRphi = bookMEProfile(ibooker,"TProfResolxMFAngleProfileRphi",hidmanager.createHistoLayer("ResolxMF_Angle_Profile_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track angle alpha"); - layerMEs.meResolxMFAngleProfileRphi->setAxisTitle("track angle alpha in "+ label,1); - layerMEs.meResolxMFAngleProfileRphi->setAxisTitle("Resolution in MF in "+ label,2); - } - if(layerswitchrapidityResProfilewclus1) { - layerMEs.merapidityResProfilewclus1 = bookMEProfile(ibooker,"TProfrapidityResProfilewclus1",hidmanager.createHistoLayer("rapidity_Res_Profile_wclus1","layer",label,"").c_str() ,"Profile of rapidity vs Res for w=1"); - layerMEs.merapidityResProfilewclus1->setAxisTitle("Res for w=1 in "+ label,1); - layerMEs.merapidityResProfilewclus1->setAxisTitle("rapidity for w=1 in "+ label,2); - } - if(layerswitchrapidityResProfilewclus2) { - layerMEs.merapidityResProfilewclus2 = bookMEProfile(ibooker,"TProfrapidityResProfilewclus2",hidmanager.createHistoLayer("rapidity_Res_Profile_wclus2","layer",label,"").c_str() ,"Profile of rapidity vs Res for w=2"); - layerMEs.merapidityResProfilewclus2->setAxisTitle("Res for w=2 in "+ label,1); - layerMEs.merapidityResProfilewclus2->setAxisTitle("rapidity for w=2 in "+ label,2); - } - if(layerswitchrapidityResProfilewclus3) { - layerMEs.merapidityResProfilewclus3 = bookMEProfile(ibooker,"TProfrapidityResProfilewclus3",hidmanager.createHistoLayer("rapidity_Res_Profile_wclus3","layer",label,"").c_str() ,"Profile of rapidity vs Res for w=3"); - layerMEs.merapidityResProfilewclus3->setAxisTitle("Res for w=3 in "+ label,1); - layerMEs.merapidityResProfilewclus3->setAxisTitle("rapidity for w=3 in "+ label,2); - } - if(layerswitchrapidityResProfilewclus4) { - layerMEs.merapidityResProfilewclus4 = bookMEProfile(ibooker,"TProfrapidityResProfilewclus4",hidmanager.createHistoLayer("rapidity_Res_Profile_wclus4","layer",label,"").c_str() ,"Profile of rapidity vs Res for w=4"); - layerMEs.merapidityResProfilewclus4->setAxisTitle("Res for w=4 in "+ label,1); - layerMEs.merapidityResProfilewclus4->setAxisTitle("rapidity for w=4 in "+ label,2); - } - - - LayerMEsMap[label]=layerMEs; - + if (layerswitchTrackangleRphi) { + layerMEs.meTrackangleRphi = bookME1D(ibooker, + "TH1TrackangleRphi", + hidmanager.createHistoLayer("Track_angle_Rphi", "layer", label, "").c_str(), + "Track angle alpha"); + layerMEs.meTrackangleRphi->setAxisTitle("Track angle in " + label); + } + if (layerswitchTrackanglebetaRphi) { + layerMEs.meTrackanglebetaRphi = + bookME1D(ibooker, + "TH1TrackanglebetaRphi", + hidmanager.createHistoLayer("Track_angle_beta_Rphi", "layer", label, "").c_str(), + "Track angle beta"); + layerMEs.meTrackanglebetaRphi->setAxisTitle("" + label); + } + if (layerswitchTrackangle2Rphi) { + layerMEs.meTrackangle2Rphi = bookME1D(ibooker, + "TH1Trackangle2Rphi", + hidmanager.createHistoLayer("Track_angle2_Rphi", "layer", label, "").c_str(), + ""); + layerMEs.meTrackangle2Rphi->setAxisTitle("" + label); + } + if (layerswitchPullTrackangleProfileRphi) { + layerMEs.mePullTrackangleProfileRphi = + bookMEProfile(ibooker, + "TProfPullTrackangleProfileRphi", + hidmanager.createHistoLayer("Pull_Trackangle_Profile_Rphi", "layer", label, "").c_str(), + "Profile of Pull in MF vs track angle alpha"); + layerMEs.mePullTrackangleProfileRphi->setAxisTitle("Track angle alpha in " + label, 1); + layerMEs.mePullTrackangleProfileRphi->setAxisTitle("Pull (MF) in " + label, 2); + } + if (layerswitchPullTrackangle2DRphi) { + layerMEs.mePullTrackangle2DRphi = + bookME1D(ibooker, + "TH1PullTrackangle2DRphi", + hidmanager.createHistoLayer("Pull_Trackangle_2D_Rphi", "layer", label, "").c_str(), + ""); + layerMEs.mePullTrackangle2DRphi->setAxisTitle("" + label); + } + if (layerswitchTrackwidthRphi) { + layerMEs.meTrackwidthRphi = bookME1D(ibooker, + "TH1TrackwidthRphi", + hidmanager.createHistoLayer("Track_width_Rphi", "layer", label, "").c_str(), + "Track width"); + layerMEs.meTrackwidthRphi->setAxisTitle("Track width in " + label); + } + if (layerswitchExpectedwidthRphi) { + layerMEs.meExpectedwidthRphi = + bookME1D(ibooker, + "TH1ExpectedwidthRphi", + hidmanager.createHistoLayer("Expected_width_Rphi", "layer", label, "").c_str(), + "Expected width"); + layerMEs.meExpectedwidthRphi->setAxisTitle("Expected width in " + label); + } + if (layerswitchClusterwidthRphi) { + layerMEs.meClusterwidthRphi = + bookME1D(ibooker, + "TH1ClusterwidthRphi", + hidmanager.createHistoLayer("Cluster_width_Rphi", "layer", label, "").c_str(), + "Cluster width"); + layerMEs.meClusterwidthRphi->setAxisTitle("Cluster width in " + label); + } + if (layerswitchCategoryRphi) { + layerMEs.meCategoryRphi = bookME1D(ibooker, + "TH1CategoryRphi", + hidmanager.createHistoLayer("Category_Rphi", "layer", label, "").c_str(), + "Category"); + layerMEs.meCategoryRphi->setAxisTitle("Category in " + label); + } + if (layerswitchPullTrackwidthProfileRphi) { + layerMEs.mePullTrackwidthProfileRphi = + bookMEProfile(ibooker, + "TProfPullTrackwidthProfileRphi", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width"); + layerMEs.mePullTrackwidthProfileRphi->setAxisTitle("track width in " + label, 1); + layerMEs.mePullTrackwidthProfileRphi->setAxisTitle("Pull (MF) in " + label, 2); + } + if (layerswitchPullTrackwidthProfileRphiwclus1) { + layerMEs.mePullTrackwidthProfileRphiwclus1 = + bookMEProfile(ibooker, + "TProfPullTrackwidthProfileRphiwclus1", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi_wclus1", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width for w=1"); + layerMEs.mePullTrackwidthProfileRphiwclus1->setAxisTitle("track width for w=1 in " + label, 1); + layerMEs.mePullTrackwidthProfileRphiwclus1->setAxisTitle("Pull (MF) for w=1 in " + label, 2); + } + if (layerswitchPullTrackwidthProfileRphiwclus2) { + layerMEs.mePullTrackwidthProfileRphiwclus2 = + bookMEProfile(ibooker, + "TProfPullTrackwidthProfileRphiwclus2", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi_wclus2", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width for w=2"); + layerMEs.mePullTrackwidthProfileRphiwclus2->setAxisTitle("track width for w=2 in " + label, 1); + layerMEs.mePullTrackwidthProfileRphiwclus2->setAxisTitle("Pull (MF) for w=2 in " + label, 2); + } + if (layerswitchPullTrackwidthProfileRphiwclus3) { + layerMEs.mePullTrackwidthProfileRphiwclus3 = + bookMEProfile(ibooker, + "TProfPullTrackwidthProfileRphiwclus3", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi_wclus3", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width for w=3"); + layerMEs.mePullTrackwidthProfileRphiwclus3->setAxisTitle("track width for w=3 in " + label, 1); + layerMEs.mePullTrackwidthProfileRphiwclus3->setAxisTitle("Pull (MF) for w=3 in " + label, 2); + } + if (layerswitchPullTrackwidthProfileRphiwclus4) { + layerMEs.mePullTrackwidthProfileRphiwclus4 = + bookMEProfile(ibooker, + "TProfPullTrackwidthProfileRphiwclus4", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi_wclus4", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width for w=4"); + layerMEs.mePullTrackwidthProfileRphiwclus4->setAxisTitle("track width for w=4 in " + label, 1); + layerMEs.mePullTrackwidthProfileRphiwclus4->setAxisTitle("Pull (MF) for w=4 in " + label, 2); + } + if (layerswitchPullTrackwidthProfileCategory1Rphi) { + layerMEs.mePullTrackwidthProfileCategory1Rphi = bookMEProfile( + ibooker, + "TProfPullTrackwidthProfileCategory1Rphi", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Category1_Rphi", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width for Category 1"); + layerMEs.mePullTrackwidthProfileCategory1Rphi->setAxisTitle("track width for Category 1 in " + label, 1); + layerMEs.mePullTrackwidthProfileCategory1Rphi->setAxisTitle("Pull (MF) for Category 1 in " + label, 2); + } + if (layerswitchPullTrackwidthProfileCategory2Rphi) { + layerMEs.mePullTrackwidthProfileCategory2Rphi = bookMEProfile( + ibooker, + "TProfPullTrackwidthProfileCategory2Rphi", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Category2_Rphi", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width for Category 2"); + layerMEs.mePullTrackwidthProfileCategory2Rphi->setAxisTitle("track width for Category 2 in " + label, 1); + layerMEs.mePullTrackwidthProfileCategory2Rphi->setAxisTitle("Pull (MF) for Category 2 in " + label, 2); + } + if (layerswitchPullTrackwidthProfileCategory3Rphi) { + layerMEs.mePullTrackwidthProfileCategory3Rphi = bookMEProfile( + ibooker, + "TProfPullTrackwidthProfileCategory3Rphi", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Category3_Rphi", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width for Category 3"); + layerMEs.mePullTrackwidthProfileCategory3Rphi->setAxisTitle("track width for Category 3 in " + label, 1); + layerMEs.mePullTrackwidthProfileCategory3Rphi->setAxisTitle("Pull (MF) for Category 3 in " + label, 2); + } + if (layerswitchPullTrackwidthProfileCategory4Rphi) { + layerMEs.mePullTrackwidthProfileCategory4Rphi = bookMEProfile( + ibooker, + "TProfPullTrackwidthProfileCategory4Rphi", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Category4_Rphi", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width for Category 4"); + layerMEs.mePullTrackwidthProfileCategory4Rphi->setAxisTitle("track width for Category 4 in " + label, 1); + layerMEs.mePullTrackwidthProfileCategory4Rphi->setAxisTitle("Pull (MF) for Category 4 in " + label, 2); + } + if (layerswitchResolxMFTrackwidthProfileRphi) { + layerMEs.meResolxMFTrackwidthProfileRphi = + bookMEProfile(ibooker, + "TProfResolxMFTrackwidthProfileRphi", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Rphi", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width"); + layerMEs.meResolxMFTrackwidthProfileRphi->setAxisTitle("track width in " + label, 1); + layerMEs.meResolxMFTrackwidthProfileRphi->setAxisTitle("Resolution in MF in " + label, 2); + } + + if (layerswitchResolxMFTrackwidthProfileWclus1Rphi) { + layerMEs.meResolxMFTrackwidthProfileWclus1Rphi = bookMEProfile( + ibooker, + "TProfResolxMFTrackwidthProfileWclus1Rphi", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Wclus1_Rphi", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width for w=1"); + layerMEs.meResolxMFTrackwidthProfileWclus1Rphi->setAxisTitle("track width for w=1 in " + label, 1); + layerMEs.meResolxMFTrackwidthProfileWclus1Rphi->setAxisTitle("Resolution in MF for w=1 in " + label, 2); + } + if (layerswitchResolxMFTrackwidthProfileWclus2Rphi) { + layerMEs.meResolxMFTrackwidthProfileWclus2Rphi = bookMEProfile( + ibooker, + "TProfResolxMFTrackwidthProfileWclus2Rphi", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Wclus2_Rphi", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width for w=2"); + layerMEs.meResolxMFTrackwidthProfileWclus2Rphi->setAxisTitle("track width for w=2 in " + label, 1); + layerMEs.meResolxMFTrackwidthProfileWclus2Rphi->setAxisTitle("Resolution in MF for w=2 in " + label, 2); + } + if (layerswitchResolxMFTrackwidthProfileWclus3Rphi) { + layerMEs.meResolxMFTrackwidthProfileWclus3Rphi = bookMEProfile( + ibooker, + "TProfResolxMFTrackwidthProfileWclus3Rphi", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Wclus3_Rphi", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width for w=3"); + layerMEs.meResolxMFTrackwidthProfileWclus3Rphi->setAxisTitle("track width for w=3 in " + label, 1); + layerMEs.meResolxMFTrackwidthProfileWclus3Rphi->setAxisTitle("Resolution in MF for w=3 in " + label, 2); + } + if (layerswitchResolxMFTrackwidthProfileWclus4Rphi) { + layerMEs.meResolxMFTrackwidthProfileWclus4Rphi = bookMEProfile( + ibooker, + "TProfResolxMFTrackwidthProfileWclus4Rphi", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Wclus4_Rphi", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width for w=4"); + layerMEs.meResolxMFTrackwidthProfileWclus4Rphi->setAxisTitle("track width for w=4 in " + label, 1); + layerMEs.meResolxMFTrackwidthProfileWclus4Rphi->setAxisTitle("Resolution in MF for w=4 in " + label, 2); + } + if (layerswitchResMFTrackwidthProfileWclus1Rphi) { + layerMEs.meResMFTrackwidthProfileWclus1Rphi = + bookMEProfile(ibooker, + "TProfResMFTrackwidthProfileWclus1Rphi", + hidmanager.createHistoLayer("ResMF_Track_width_Profile_Wclus1_Rphi", "layer", label, "").c_str(), + "Profile of Residuals(x) in MF vs track width for w=1"); + layerMEs.meResMFTrackwidthProfileWclus1Rphi->setAxisTitle("track width for w=1 in " + label, 1); + layerMEs.meResMFTrackwidthProfileWclus1Rphi->setAxisTitle("Residuals(x) in MF for w=1 in " + label, 2); + } + if (layerswitchResMFTrackwidthProfileWclus2Rphi) { + layerMEs.meResMFTrackwidthProfileWclus2Rphi = + bookMEProfile(ibooker, + "TProfResMFTrackwidthProfileWclus2Rphi", + hidmanager.createHistoLayer("ResMF_Track_width_Profile_Wclus2_Rphi", "layer", label, "").c_str(), + "Profile of Residuals(x) in MF vs track width for w=2"); + layerMEs.meResMFTrackwidthProfileWclus2Rphi->setAxisTitle("track width for w=2 in " + label, 1); + layerMEs.meResMFTrackwidthProfileWclus2Rphi->setAxisTitle("Residuals(x) in MF for w=2 in " + label, 2); + } + if (layerswitchResMFTrackwidthProfileWclus3Rphi) { + layerMEs.meResMFTrackwidthProfileWclus3Rphi = + bookMEProfile(ibooker, + "TProfResMFTrackwidthProfileWclus3Rphi", + hidmanager.createHistoLayer("ResMF_Track_width_Profile_Wclus3_Rphi", "layer", label, "").c_str(), + "Profile of Residuals(x) in MF vs track width for w=3"); + layerMEs.meResMFTrackwidthProfileWclus3Rphi->setAxisTitle("track width for w=3 in " + label, 1); + layerMEs.meResMFTrackwidthProfileWclus3Rphi->setAxisTitle("Residuals(x) in MF for w=3 in " + label, 2); + } + if (layerswitchResMFTrackwidthProfileWclus4Rphi) { + layerMEs.meResMFTrackwidthProfileWclus4Rphi = + bookMEProfile(ibooker, + "TProfResMFTrackwidthProfileWclus4Rphi", + hidmanager.createHistoLayer("ResMF_Track_width_Profile_Wclus4_Rphi", "layer", label, "").c_str(), + "Profile of Residuals(x) in MF vs track width for w=4"); + layerMEs.meResMFTrackwidthProfileWclus4Rphi->setAxisTitle("track width for w=4 in " + label, 1); + layerMEs.meResMFTrackwidthProfileWclus4Rphi->setAxisTitle("Residuals(x) in MF for w=4 in " + label, 2); + } + + if (layerswitchResolxMFTrackwidthProfileCategory1Rphi) { + layerMEs.meResolxMFTrackwidthProfileCategory1Rphi = bookMEProfile( + ibooker, + "TProfResolxMFTrackwidthProfileCategory1Rphi", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category1_Rphi", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width for Category 1"); + layerMEs.meResolxMFTrackwidthProfileCategory1Rphi->setAxisTitle("track width for Category 1 in " + label, 1); + layerMEs.meResolxMFTrackwidthProfileCategory1Rphi->setAxisTitle("Resolution in MF for Category 1 in " + label, 2); + } + if (layerswitchResolxMFTrackwidthProfileCategory2Rphi) { + layerMEs.meResolxMFTrackwidthProfileCategory2Rphi = bookMEProfile( + ibooker, + "TProfResolxMFTrackwidthProfileCategory2Rphi", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category2_Rphi", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width for Category 2"); + layerMEs.meResolxMFTrackwidthProfileCategory2Rphi->setAxisTitle("track width for Category 2 in " + label, 1); + layerMEs.meResolxMFTrackwidthProfileCategory2Rphi->setAxisTitle("Resolution in MF for Category 2 in " + label, 2); + } + if (layerswitchResolxMFTrackwidthProfileCategory3Rphi) { + layerMEs.meResolxMFTrackwidthProfileCategory3Rphi = bookMEProfile( + ibooker, + "TProfResolxMFTrackwidthProfileCategory3Rphi", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category3_Rphi", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width for Category 3"); + layerMEs.meResolxMFTrackwidthProfileCategory3Rphi->setAxisTitle("track width for Category 3 in " + label, 1); + layerMEs.meResolxMFTrackwidthProfileCategory3Rphi->setAxisTitle("Resolution in MF for Category 3 in " + label, 2); + } + if (layerswitchResolxMFTrackwidthProfileCategory4Rphi) { + layerMEs.meResolxMFTrackwidthProfileCategory4Rphi = bookMEProfile( + ibooker, + "TProfResolxMFTrackwidthProfileCategory4Rphi", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category3_Rphi", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width for Category 4"); + layerMEs.meResolxMFTrackwidthProfileCategory4Rphi->setAxisTitle("track width for Category 4 in " + label, 1); + layerMEs.meResolxMFTrackwidthProfileCategory4Rphi->setAxisTitle("Resolution in MF for Category 4 in " + label, 2); + } + if (layerswitchResolxMFClusterwidthProfileCategory1Rphi) { + layerMEs.meResolxMFClusterwidthProfileCategory1Rphi = bookMEProfile( + ibooker, + "TProfResolxMFClusterwidthProfileCategory1Rphi", + hidmanager.createHistoLayer("ResolxMF_Cluster_width_Profile_Category1_Rphi", "layer", label, "").c_str(), + "Profile of Resolution in MF vs cluster width for Category 1"); + layerMEs.meResolxMFClusterwidthProfileCategory1Rphi->setAxisTitle("cluster width for Category 1 in " + label, 1); + layerMEs.meResolxMFClusterwidthProfileCategory1Rphi->setAxisTitle("Resolution in MF for Category 1 in " + label, 2); + } + if (layerswitchResolxMFAngleProfileRphi) { + layerMEs.meResolxMFAngleProfileRphi = + bookMEProfile(ibooker, + "TProfResolxMFAngleProfileRphi", + hidmanager.createHistoLayer("ResolxMF_Angle_Profile_Rphi", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track angle alpha"); + layerMEs.meResolxMFAngleProfileRphi->setAxisTitle("track angle alpha in " + label, 1); + layerMEs.meResolxMFAngleProfileRphi->setAxisTitle("Resolution in MF in " + label, 2); + } + if (layerswitchrapidityResProfilewclus1) { + layerMEs.merapidityResProfilewclus1 = + bookMEProfile(ibooker, + "TProfrapidityResProfilewclus1", + hidmanager.createHistoLayer("rapidity_Res_Profile_wclus1", "layer", label, "").c_str(), + "Profile of rapidity vs Res for w=1"); + layerMEs.merapidityResProfilewclus1->setAxisTitle("Res for w=1 in " + label, 1); + layerMEs.merapidityResProfilewclus1->setAxisTitle("rapidity for w=1 in " + label, 2); + } + if (layerswitchrapidityResProfilewclus2) { + layerMEs.merapidityResProfilewclus2 = + bookMEProfile(ibooker, + "TProfrapidityResProfilewclus2", + hidmanager.createHistoLayer("rapidity_Res_Profile_wclus2", "layer", label, "").c_str(), + "Profile of rapidity vs Res for w=2"); + layerMEs.merapidityResProfilewclus2->setAxisTitle("Res for w=2 in " + label, 1); + layerMEs.merapidityResProfilewclus2->setAxisTitle("rapidity for w=2 in " + label, 2); + } + if (layerswitchrapidityResProfilewclus3) { + layerMEs.merapidityResProfilewclus3 = + bookMEProfile(ibooker, + "TProfrapidityResProfilewclus3", + hidmanager.createHistoLayer("rapidity_Res_Profile_wclus3", "layer", label, "").c_str(), + "Profile of rapidity vs Res for w=3"); + layerMEs.merapidityResProfilewclus3->setAxisTitle("Res for w=3 in " + label, 1); + layerMEs.merapidityResProfilewclus3->setAxisTitle("rapidity for w=3 in " + label, 2); + } + if (layerswitchrapidityResProfilewclus4) { + layerMEs.merapidityResProfilewclus4 = + bookMEProfile(ibooker, + "TProfrapidityResProfilewclus4", + hidmanager.createHistoLayer("rapidity_Res_Profile_wclus4", "layer", label, "").c_str(), + "Profile of rapidity vs Res for w=4"); + layerMEs.merapidityResProfilewclus4->setAxisTitle("Res for w=4 in " + label, 1); + layerMEs.merapidityResProfilewclus4->setAxisTitle("rapidity for w=4 in " + label, 2); + } + + LayerMEsMap[label] = layerMEs; } //------------------------------------------------------------------------------------------ -void SiStripTrackingRecHitsValid::createStereoAndMatchedMEs(DQMStore::IBooker & ibooker,std::string label) -{ +void SiStripTrackingRecHitsValid::createStereoAndMatchedMEs(DQMStore::IBooker &ibooker, std::string label) { SiStripHistoId hidmanager; - StereoAndMatchedMEs stereoandmatchedMEs; + StereoAndMatchedMEs stereoandmatchedMEs; stereoandmatchedMEs.meWclusSas = nullptr; stereoandmatchedMEs.meAdcSas = nullptr; @@ -1895,192 +2363,336 @@ void SiStripTrackingRecHitsValid::createStereoAndMatchedMEs(DQMStore::IBooker & stereoandmatchedMEs.mePullyMatched = nullptr; //WclusSas - if(layerswitchWclusSas) { - stereoandmatchedMEs.meWclusSas = bookME1D(ibooker,"TH1WclusSas", hidmanager.createHistoLayer("Wclus_sas","layer",label,"").c_str() ,"Cluster Width - Number of strips that belong to the RecHit cluster"); - stereoandmatchedMEs.meWclusSas->setAxisTitle("Cluster Width [nr strips] (stereo) in "+ label); + if (layerswitchWclusSas) { + stereoandmatchedMEs.meWclusSas = bookME1D(ibooker, + "TH1WclusSas", + hidmanager.createHistoLayer("Wclus_sas", "layer", label, "").c_str(), + "Cluster Width - Number of strips that belong to the RecHit cluster"); + stereoandmatchedMEs.meWclusSas->setAxisTitle("Cluster Width [nr strips] (stereo) in " + label); } //AdcSas - if(layerswitchAdcSas) { - stereoandmatchedMEs.meAdcSas = bookME1D(ibooker,"TH1AdcSas", hidmanager.createHistoLayer("Adc_sas","layer",label,"").c_str() ,"RecHit Cluster Charge"); + if (layerswitchAdcSas) { + stereoandmatchedMEs.meAdcSas = bookME1D(ibooker, + "TH1AdcSas", + hidmanager.createHistoLayer("Adc_sas", "layer", label, "").c_str(), + "RecHit Cluster Charge"); stereoandmatchedMEs.meAdcSas->setAxisTitle("cluster charge [ADC] (stereo) in " + label); } //ResolxLFSas - if(layerswitchResolxLFSas) { - stereoandmatchedMEs.meResolxLFSas = bookME1D(ibooker,"TH1ResolxLFSas", hidmanager.createHistoLayer("Resolx_LF_sas","layer",label,"").c_str() ,"RecHit resol(x) coord."); + if (layerswitchResolxLFSas) { + stereoandmatchedMEs.meResolxLFSas = + bookME1D(ibooker, + "TH1ResolxLFSas", + hidmanager.createHistoLayer("Resolx_LF_sas", "layer", label, "").c_str(), + "RecHit resol(x) coord."); stereoandmatchedMEs.meResolxLFSas->setAxisTitle("resol(x) RecHit coord. (local frame) (stereo) in " + label); } //ResolxMFSas - if(layerswitchResolxMFSas) { - stereoandmatchedMEs.meResolxMFSas = bookME1D(ibooker,"TH1ResolxMFSas", hidmanager.createHistoLayer("Resolx_MF_sas","layer",label,"").c_str() ,"RecHit resol(x) coord."); + if (layerswitchResolxMFSas) { + stereoandmatchedMEs.meResolxMFSas = + bookME1D(ibooker, + "TH1ResolxMFSas", + hidmanager.createHistoLayer("Resolx_MF_sas", "layer", label, "").c_str(), + "RecHit resol(x) coord."); stereoandmatchedMEs.meResolxMFSas->setAxisTitle("resol(x) RecHit coord. (measurement frame) (stereo) in " + label); } //ResLFSas - if(layerswitchResLFSas) { - stereoandmatchedMEs.meResLFSas = bookME1D(ibooker,"TH1ResLFSas", hidmanager.createHistoLayer("Res_LF_sas","layer",label,"").c_str() ,"Residual of the hit x coordinate"); + if (layerswitchResLFSas) { + stereoandmatchedMEs.meResLFSas = bookME1D(ibooker, + "TH1ResLFSas", + hidmanager.createHistoLayer("Res_LF_sas", "layer", label, "").c_str(), + "Residual of the hit x coordinate"); stereoandmatchedMEs.meResLFSas->setAxisTitle("Hit Residuals(x) (local frame) (stereo) in " + label); } //ResMFSas - if(layerswitchResMFSas) { - stereoandmatchedMEs.meResMFSas = bookME1D(ibooker,"TH1ResMFSas", hidmanager.createHistoLayer("Res_MF_sas","layer",label,"").c_str() ,"Residual of the hit x coordinate"); + if (layerswitchResMFSas) { + stereoandmatchedMEs.meResMFSas = bookME1D(ibooker, + "TH1ResMFSas", + hidmanager.createHistoLayer("Res_MF_sas", "layer", label, "").c_str(), + "Residual of the hit x coordinate"); stereoandmatchedMEs.meResMFSas->setAxisTitle("Hit Residuals(x) (stereo) in " + label); } //PullLFSas - if(layerswitchPullLFSas) { - stereoandmatchedMEs.mePullLFSas = bookME1D(ibooker,"TH1PullLFSas", hidmanager.createHistoLayer("Pull_LF_sas","layer",label,"").c_str() ,"Pull distribution"); + if (layerswitchPullLFSas) { + stereoandmatchedMEs.mePullLFSas = bookME1D(ibooker, + "TH1PullLFSas", + hidmanager.createHistoLayer("Pull_LF_sas", "layer", label, "").c_str(), + "Pull distribution"); stereoandmatchedMEs.mePullLFSas->setAxisTitle("Pull distribution (local frame) (stereo) in " + label); } //PullMFSas - if(layerswitchPullMFSas) { - stereoandmatchedMEs.mePullMFSas = bookME1D(ibooker,"TH1PullMFSas", hidmanager.createHistoLayer("Pull_MF_sas","layer",label,"").c_str() ,"Pull distribution"); + if (layerswitchPullMFSas) { + stereoandmatchedMEs.mePullMFSas = bookME1D(ibooker, + "TH1PullMFSas", + hidmanager.createHistoLayer("Pull_MF_sas", "layer", label, "").c_str(), + "Pull distribution"); stereoandmatchedMEs.mePullMFSas->setAxisTitle("Pull distribution (measurement frame) (stereo) in " + label); } - if(layerswitchTrackangleSas) { - stereoandmatchedMEs.meTrackangleSas = bookME1D(ibooker,"TH1TrackangleSas",hidmanager.createHistoLayer("Track_angle_Sas","layer",label,"").c_str() ,"Track angle"); + if (layerswitchTrackangleSas) { + stereoandmatchedMEs.meTrackangleSas = + bookME1D(ibooker, + "TH1TrackangleSas", + hidmanager.createHistoLayer("Track_angle_Sas", "layer", label, "").c_str(), + "Track angle"); stereoandmatchedMEs.meTrackangleSas->setAxisTitle("Track angle (stereo) in " + label); } - if(layerswitchTrackanglebetaSas) { - stereoandmatchedMEs.meTrackanglebetaSas = bookME1D(ibooker,"TH1TrackanglebetaSas",hidmanager.createHistoLayer("Track_angle_beta_Sas","layer",label,"").c_str() ,"Track angle beta"); + if (layerswitchTrackanglebetaSas) { + stereoandmatchedMEs.meTrackanglebetaSas = + bookME1D(ibooker, + "TH1TrackanglebetaSas", + hidmanager.createHistoLayer("Track_angle_beta_Sas", "layer", label, "").c_str(), + "Track angle beta"); stereoandmatchedMEs.meTrackanglebetaSas->setAxisTitle("Track angle beta (stereo) in " + label); } - if(layerswitchPullTrackangleProfileSas) { - stereoandmatchedMEs.mePullTrackangleProfileSas = bookMEProfile(ibooker,"TProfPullTrackangleProfileSas",hidmanager.createHistoLayer("Pull_Track_angle_Profile_Sas","layer",label,"").c_str() ,"Profile of Pull in MF vs track angle (stereo)"); - stereoandmatchedMEs.mePullTrackangleProfileSas->setAxisTitle("track angle (stereo) in " + label,1); - stereoandmatchedMEs.mePullTrackangleProfileSas->setAxisTitle("Pull in MF (stereo) in " + label,2); - } - if(layerswitchTrackwidthSas) { - stereoandmatchedMEs.meTrackwidthSas = bookME1D(ibooker,"TH1TrackwidthSas",hidmanager.createHistoLayer("Track_width_Sas","layer",label,"").c_str() ,"Track width"); + if (layerswitchPullTrackangleProfileSas) { + stereoandmatchedMEs.mePullTrackangleProfileSas = + bookMEProfile(ibooker, + "TProfPullTrackangleProfileSas", + hidmanager.createHistoLayer("Pull_Track_angle_Profile_Sas", "layer", label, "").c_str(), + "Profile of Pull in MF vs track angle (stereo)"); + stereoandmatchedMEs.mePullTrackangleProfileSas->setAxisTitle("track angle (stereo) in " + label, 1); + stereoandmatchedMEs.mePullTrackangleProfileSas->setAxisTitle("Pull in MF (stereo) in " + label, 2); + } + if (layerswitchTrackwidthSas) { + stereoandmatchedMEs.meTrackwidthSas = + bookME1D(ibooker, + "TH1TrackwidthSas", + hidmanager.createHistoLayer("Track_width_Sas", "layer", label, "").c_str(), + "Track width"); stereoandmatchedMEs.meTrackwidthSas->setAxisTitle("Track width (stereo) in " + label); } - if(layerswitchExpectedwidthSas) { - stereoandmatchedMEs.meExpectedwidthSas = bookME1D(ibooker,"TH1ExpectedwidthSas",hidmanager.createHistoLayer("Expected_width_Sas","layer",label,"").c_str() ,"Expected width"); + if (layerswitchExpectedwidthSas) { + stereoandmatchedMEs.meExpectedwidthSas = + bookME1D(ibooker, + "TH1ExpectedwidthSas", + hidmanager.createHistoLayer("Expected_width_Sas", "layer", label, "").c_str(), + "Expected width"); stereoandmatchedMEs.meExpectedwidthSas->setAxisTitle("Expected width (stereo) in " + label); } - if(layerswitchClusterwidthSas) { - stereoandmatchedMEs.meClusterwidthSas = bookME1D(ibooker,"TH1ClusterwidthSas",hidmanager.createHistoLayer("Cluster_width_Sas","layer",label,"").c_str() ,"Cluster width"); + if (layerswitchClusterwidthSas) { + stereoandmatchedMEs.meClusterwidthSas = + bookME1D(ibooker, + "TH1ClusterwidthSas", + hidmanager.createHistoLayer("Cluster_width_Sas", "layer", label, "").c_str(), + "Cluster width"); stereoandmatchedMEs.meClusterwidthSas->setAxisTitle("Cluster width (stereo) in " + label); } - if(layerswitchCategorySas) { - stereoandmatchedMEs.meCategorySas = bookME1D(ibooker,"TH1CategorySas",hidmanager.createHistoLayer("Category_Sas","layer",label,"").c_str() ,"Category"); + if (layerswitchCategorySas) { + stereoandmatchedMEs.meCategorySas = bookME1D( + ibooker, "TH1CategorySas", hidmanager.createHistoLayer("Category_Sas", "layer", label, "").c_str(), "Category"); stereoandmatchedMEs.meCategorySas->setAxisTitle("Category (stereo) in " + label); } - if(layerswitchPullTrackwidthProfileSas) { - stereoandmatchedMEs.mePullTrackwidthProfileSas = bookMEProfile(ibooker,"TProfPullTrackwidthProfileSas",hidmanager.createHistoLayer("Pull_Track_width_Profile_Sas","layer",label,"").c_str() ,"Profile of Pull in MF vs track width (stereo)"); - stereoandmatchedMEs.mePullTrackwidthProfileSas->setAxisTitle("track width (stereo) in " + label,1); - stereoandmatchedMEs.mePullTrackwidthProfileSas->setAxisTitle("Pull in MF (stereo) in " + label,2); - } - if(layerswitchPullTrackwidthProfileCategory1Sas) { - stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory1Sas",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category1_Sas","layer",label,"").c_str() ,"Profile of Pull in MF vs track width (Category 1) (stereo)"); - stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas->setAxisTitle("track width (Category 1) (stereo) in " + label,1); - stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas->setAxisTitle("Pull in MF (Category 1) (stereo) in " + label,2); - } - if(layerswitchPullTrackwidthProfileCategory2Sas) { - stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory2Sas",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category2_Sas","layer",label,"").c_str() ,"Profile of Pull in MF vs track width (Category 2) (stereo)"); - stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas->setAxisTitle("track width (Category 2) (stereo) in " + label,1); - stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas->setAxisTitle("Pull in MF (Category 2) (stereo) in " + label,2); - } - if(layerswitchPullTrackwidthProfileCategory3Sas) { - stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory3Sas",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category3_Sas","layer",label,"").c_str() ,"Profile of Pull in MF vs track width (Category 3) (stereo)"); - stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas->setAxisTitle("track width (Category 3) (stereo) in " + label,1); - stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas->setAxisTitle("Pull in MF (Category 3) (stereo) in " + label,2); - } - if(layerswitchPullTrackwidthProfileCategory4Sas) { - stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory4Sas",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category4_Sas","layer",label,"").c_str() ,"Profile of Pull in MF vs track width (Category 4) (stereo)"); - stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas->setAxisTitle("track width (Category 4) (stereo) in " + label,1); - stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas->setAxisTitle("Pull in MF (Category 4) (stereo) in " + label,2); - } - if(layerswitchResolxMFTrackwidthProfileSas) { - stereoandmatchedMEs.meResolxMFTrackwidthProfileSas = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileSas",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width (stereo)"); - stereoandmatchedMEs.meResolxMFTrackwidthProfileSas->setAxisTitle("track width (stereo) in " + label,1); - stereoandmatchedMEs.meResolxMFTrackwidthProfileSas->setAxisTitle("Resolution in MF (stereo) in " + label,2); - } - if(layerswitchResolxMFTrackwidthProfileCategory1Sas) { - stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory1Sas",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category1_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width (Category 1) (stereo)"); - stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas->setAxisTitle(" track width (Category 1) (stereo) in " + label,1); - stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas->setAxisTitle(" Resolution in MF (Category 1) (stereo) in " + label,2); - } - if(layerswitchResolxMFTrackwidthProfileCategory2Sas) { - stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory2Sas",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category2_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width (Category 2) (stereo)"); - stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas->setAxisTitle(" track width (Category 2) (stereo) in " + label,1); - stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas->setAxisTitle(" Resolution in MF (Category 2) (stereo) in " + label,2); - } - if(layerswitchResolxMFTrackwidthProfileCategory3Sas) { - stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory3Sas",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category3_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width (Category 3) (stereo)"); - stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas->setAxisTitle(" track width (Category 3) (stereo) in " + label,1); - stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas->setAxisTitle(" Resolution in MF (Category 3) (stereo) in " + label,2); - } - if(layerswitchResolxMFTrackwidthProfileCategory4Sas) { - stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory4Sas",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category4_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width (Category 4) (stereo)"); - stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas->setAxisTitle(" track width (Category 4) (stereo) in " + label,1); - stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas->setAxisTitle(" Resolution in MF (Category 4) (stereo) in " + label,2); - } - if(layerswitchResolxMFClusterwidthProfileCategory1Sas) { - stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas = bookMEProfile(ibooker,"TProfResolxMFClusterwidthProfileCategory1Sas",hidmanager.createHistoLayer("ResolxMF_Cluster_width_Profile_Category1_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs cluster width (Category 1) (stereo)"); - stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas->setAxisTitle("cluster width (Category 1) (stereo) in " + label,1); - stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas->setAxisTitle(" Resolution in MF (Category 1) (stereo) in " + label,2); - } - if(layerswitchResolxMFAngleProfileSas) { - stereoandmatchedMEs.meResolxMFAngleProfileSas = bookMEProfile(ibooker,"TProfResolxMFAngleProfileSas",hidmanager.createHistoLayer("ResolxMF_Angle_Profile_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track angle (stereo)"); - stereoandmatchedMEs.meResolxMFAngleProfileSas->setAxisTitle("track angle (stereo) in " + label,1); - stereoandmatchedMEs.meResolxMFAngleProfileSas->setAxisTitle("Resolution in MF (stereo) in " + label,2); + if (layerswitchPullTrackwidthProfileSas) { + stereoandmatchedMEs.mePullTrackwidthProfileSas = + bookMEProfile(ibooker, + "TProfPullTrackwidthProfileSas", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Sas", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width (stereo)"); + stereoandmatchedMEs.mePullTrackwidthProfileSas->setAxisTitle("track width (stereo) in " + label, 1); + stereoandmatchedMEs.mePullTrackwidthProfileSas->setAxisTitle("Pull in MF (stereo) in " + label, 2); + } + if (layerswitchPullTrackwidthProfileCategory1Sas) { + stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas = + bookMEProfile(ibooker, + "TProfPullTrackwidthProfileCategory1Sas", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Category1_Sas", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width (Category 1) (stereo)"); + stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas->setAxisTitle( + "track width (Category 1) (stereo) in " + label, 1); + stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas->setAxisTitle( + "Pull in MF (Category 1) (stereo) in " + label, 2); + } + if (layerswitchPullTrackwidthProfileCategory2Sas) { + stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas = + bookMEProfile(ibooker, + "TProfPullTrackwidthProfileCategory2Sas", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Category2_Sas", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width (Category 2) (stereo)"); + stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas->setAxisTitle( + "track width (Category 2) (stereo) in " + label, 1); + stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas->setAxisTitle( + "Pull in MF (Category 2) (stereo) in " + label, 2); + } + if (layerswitchPullTrackwidthProfileCategory3Sas) { + stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas = + bookMEProfile(ibooker, + "TProfPullTrackwidthProfileCategory3Sas", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Category3_Sas", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width (Category 3) (stereo)"); + stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas->setAxisTitle( + "track width (Category 3) (stereo) in " + label, 1); + stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas->setAxisTitle( + "Pull in MF (Category 3) (stereo) in " + label, 2); + } + if (layerswitchPullTrackwidthProfileCategory4Sas) { + stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas = + bookMEProfile(ibooker, + "TProfPullTrackwidthProfileCategory4Sas", + hidmanager.createHistoLayer("Pull_Track_width_Profile_Category4_Sas", "layer", label, "").c_str(), + "Profile of Pull in MF vs track width (Category 4) (stereo)"); + stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas->setAxisTitle( + "track width (Category 4) (stereo) in " + label, 1); + stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas->setAxisTitle( + "Pull in MF (Category 4) (stereo) in " + label, 2); + } + if (layerswitchResolxMFTrackwidthProfileSas) { + stereoandmatchedMEs.meResolxMFTrackwidthProfileSas = + bookMEProfile(ibooker, + "TProfResolxMFTrackwidthProfileSas", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Sas", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width (stereo)"); + stereoandmatchedMEs.meResolxMFTrackwidthProfileSas->setAxisTitle("track width (stereo) in " + label, 1); + stereoandmatchedMEs.meResolxMFTrackwidthProfileSas->setAxisTitle("Resolution in MF (stereo) in " + label, 2); + } + if (layerswitchResolxMFTrackwidthProfileCategory1Sas) { + stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas = bookMEProfile( + ibooker, + "TProfResolxMFTrackwidthProfileCategory1Sas", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category1_Sas", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width (Category 1) (stereo)"); + stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas->setAxisTitle( + " track width (Category 1) (stereo) in " + label, 1); + stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas->setAxisTitle( + " Resolution in MF (Category 1) (stereo) in " + label, 2); + } + if (layerswitchResolxMFTrackwidthProfileCategory2Sas) { + stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas = bookMEProfile( + ibooker, + "TProfResolxMFTrackwidthProfileCategory2Sas", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category2_Sas", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width (Category 2) (stereo)"); + stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas->setAxisTitle( + " track width (Category 2) (stereo) in " + label, 1); + stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas->setAxisTitle( + " Resolution in MF (Category 2) (stereo) in " + label, 2); + } + if (layerswitchResolxMFTrackwidthProfileCategory3Sas) { + stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas = bookMEProfile( + ibooker, + "TProfResolxMFTrackwidthProfileCategory3Sas", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category3_Sas", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width (Category 3) (stereo)"); + stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas->setAxisTitle( + " track width (Category 3) (stereo) in " + label, 1); + stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas->setAxisTitle( + " Resolution in MF (Category 3) (stereo) in " + label, 2); + } + if (layerswitchResolxMFTrackwidthProfileCategory4Sas) { + stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas = bookMEProfile( + ibooker, + "TProfResolxMFTrackwidthProfileCategory4Sas", + hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category4_Sas", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track width (Category 4) (stereo)"); + stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas->setAxisTitle( + " track width (Category 4) (stereo) in " + label, 1); + stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas->setAxisTitle( + " Resolution in MF (Category 4) (stereo) in " + label, 2); + } + if (layerswitchResolxMFClusterwidthProfileCategory1Sas) { + stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas = bookMEProfile( + ibooker, + "TProfResolxMFClusterwidthProfileCategory1Sas", + hidmanager.createHistoLayer("ResolxMF_Cluster_width_Profile_Category1_Sas", "layer", label, "").c_str(), + "Profile of Resolution in MF vs cluster width (Category 1) (stereo)"); + stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas->setAxisTitle( + "cluster width (Category 1) (stereo) in " + label, 1); + stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas->setAxisTitle( + " Resolution in MF (Category 1) (stereo) in " + label, 2); + } + if (layerswitchResolxMFAngleProfileSas) { + stereoandmatchedMEs.meResolxMFAngleProfileSas = + bookMEProfile(ibooker, + "TProfResolxMFAngleProfileSas", + hidmanager.createHistoLayer("ResolxMF_Angle_Profile_Sas", "layer", label, "").c_str(), + "Profile of Resolution in MF vs track angle (stereo)"); + stereoandmatchedMEs.meResolxMFAngleProfileSas->setAxisTitle("track angle (stereo) in " + label, 1); + stereoandmatchedMEs.meResolxMFAngleProfileSas->setAxisTitle("Resolution in MF (stereo) in " + label, 2); } //PosxMatched - if(layerswitchPosxMatched) { - stereoandmatchedMEs.mePosxMatched = bookME1D(ibooker,"TH1PosxMatched", hidmanager.createHistoLayer("Posx_matched","layer",label,"").c_str() ,"RecHit x coord."); + if (layerswitchPosxMatched) { + stereoandmatchedMEs.mePosxMatched = + bookME1D(ibooker, + "TH1PosxMatched", + hidmanager.createHistoLayer("Posx_matched", "layer", label, "").c_str(), + "RecHit x coord."); stereoandmatchedMEs.mePosxMatched->setAxisTitle("x coord. matched RecHit (local frame) in " + label); } //PosyMatched - if(layerswitchPosyMatched) { - stereoandmatchedMEs.mePosyMatched = bookME1D(ibooker,"TH1PosyMatched", hidmanager.createHistoLayer("Posy_matched","layer",label,"").c_str() ,"RecHit y coord."); + if (layerswitchPosyMatched) { + stereoandmatchedMEs.mePosyMatched = + bookME1D(ibooker, + "TH1PosyMatched", + hidmanager.createHistoLayer("Posy_matched", "layer", label, "").c_str(), + "RecHit y coord."); stereoandmatchedMEs.mePosyMatched->setAxisTitle("y coord. matched RecHit (local frame) in " + label); } //ResolxMatched - if(layerswitchResolxMatched) { - stereoandmatchedMEs.meResolxMatched = bookME1D(ibooker,"TH1ResolxMatched", hidmanager.createHistoLayer("Resolx_matched","layer",label,"").c_str() ,"RecHit resol(x) coord."); + if (layerswitchResolxMatched) { + stereoandmatchedMEs.meResolxMatched = + bookME1D(ibooker, + "TH1ResolxMatched", + hidmanager.createHistoLayer("Resolx_matched", "layer", label, "").c_str(), + "RecHit resol(x) coord."); stereoandmatchedMEs.meResolxMatched->setAxisTitle("resol(x) coord. matched RecHit (local frame) in " + label); } //ResolyMatched - if(layerswitchResolyMatched) { - stereoandmatchedMEs.meResolyMatched = bookME1D(ibooker,"TH1ResolyMatched", hidmanager.createHistoLayer("Resoly_matched","layer",label,"").c_str() ,"RecHit resol(y) coord."); + if (layerswitchResolyMatched) { + stereoandmatchedMEs.meResolyMatched = + bookME1D(ibooker, + "TH1ResolyMatched", + hidmanager.createHistoLayer("Resoly_matched", "layer", label, "").c_str(), + "RecHit resol(y) coord."); stereoandmatchedMEs.meResolyMatched->setAxisTitle("resol(y) coord. matched RecHit (local frame) in " + label); } //ResxMatched - if(layerswitchResxMatched) { - stereoandmatchedMEs.meResxMatched = bookME1D(ibooker,"TH1ResxMatched", hidmanager.createHistoLayer("Resx_matched","layer",label,"").c_str() ,"Residual of the hit x coord."); + if (layerswitchResxMatched) { + stereoandmatchedMEs.meResxMatched = + bookME1D(ibooker, + "TH1ResxMatched", + hidmanager.createHistoLayer("Resx_matched", "layer", label, "").c_str(), + "Residual of the hit x coord."); stereoandmatchedMEs.meResxMatched->setAxisTitle("Residuals(x) in matched RecHit in " + label); } //ResyMatched - if(layerswitchResyMatched) { - stereoandmatchedMEs.meResyMatched = bookME1D(ibooker,"TH1ResyMatched", hidmanager.createHistoLayer("Resy_matched","layer",label,"").c_str() ,"Residual of the hit x coord."); + if (layerswitchResyMatched) { + stereoandmatchedMEs.meResyMatched = + bookME1D(ibooker, + "TH1ResyMatched", + hidmanager.createHistoLayer("Resy_matched", "layer", label, "").c_str(), + "Residual of the hit x coord."); stereoandmatchedMEs.meResyMatched->setAxisTitle("Res(y) in matched RecHit in " + label); } - StereoAndMatchedMEsMap[label]=stereoandmatchedMEs; - + StereoAndMatchedMEsMap[label] = stereoandmatchedMEs; } //------------------------------------------------------------------------------------------ -inline MonitorElement* SiStripTrackingRecHitsValid::bookME1D(DQMStore::IBooker & ibooker,const char* ParameterSetLabel, const char* HistoName, const char* HistoTitle) -{ - Parameters = conf_.getParameter(ParameterSetLabel); - return ibooker.book1D(HistoName,HistoTitle, - Parameters.getParameter("Nbinx"), - Parameters.getParameter("xmin"), - Parameters.getParameter("xmax") - ); +inline MonitorElement *SiStripTrackingRecHitsValid::bookME1D(DQMStore::IBooker &ibooker, + const char *ParameterSetLabel, + const char *HistoName, + const char *HistoTitle) { + Parameters = conf_.getParameter(ParameterSetLabel); + return ibooker.book1D(HistoName, + HistoTitle, + Parameters.getParameter("Nbinx"), + Parameters.getParameter("xmin"), + Parameters.getParameter("xmax")); } //------------------------------------------------------------------------------------------ -inline MonitorElement* SiStripTrackingRecHitsValid::bookMEProfile(DQMStore::IBooker & ibooker,const char* ParameterSetLabel, const char* HistoName, const char* HistoTitle) -{ - Parameters = conf_.getParameter(ParameterSetLabel); +inline MonitorElement *SiStripTrackingRecHitsValid::bookMEProfile(DQMStore::IBooker &ibooker, + const char *ParameterSetLabel, + const char *HistoName, + const char *HistoTitle) { + Parameters = conf_.getParameter(ParameterSetLabel); //The number of channels in Y is disregarded in a profile plot. - return ibooker.bookProfile(HistoName,HistoTitle, - Parameters.getParameter("Nbinx"), - Parameters.getParameter("xmin"), - Parameters.getParameter("xmax"), - Parameters.getParameter("ymin"), - Parameters.getParameter("ymax"), - "" - ); + return ibooker.bookProfile(HistoName, + HistoTitle, + Parameters.getParameter("Nbinx"), + Parameters.getParameter("xmin"), + Parameters.getParameter("xmax"), + Parameters.getParameter("ymin"), + Parameters.getParameter("ymax"), + ""); } // DEFINE_FWK_MODULE(SiStripTrackingRecHitsValid);