CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HSCPValidator Class Reference

#include <HSCPValidation/HSCPValidator/src/HSCPValidator.cc>

Inheritance diagram for HSCPValidator:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 HSCPValidator (const edm::ParameterSet &)
 
 ~HSCPValidator () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
bool IncreasedTreshold (const trigger::TriggerEvent &trEv, const edm::InputTag &InputPath, double NewThreshold, double etaCut, int NObjectAboveThreshold, bool averageThreshold)
 
std::string intToString (int num)
 
void makeGenPlots (const edm::Event &iEvent)
 
void makeHLTPlots (const edm::Event &iEvent)
 
void makeRecoPlots (const edm::Event &iEvent)
 
void makeSimDigiPlotsECAL (const edm::Event &iEvent)
 
void makeSimDigiPlotsRPC (const edm::Event &iEvent)
 
void makeSimTrackPlots (const edm::Event &iEvent)
 

Private Attributes

TH1F * cluSizeDistribution_
 
edm::EDGetTokenT< edm::ValueMap< reco::DeDxData > > dEdxTrackToken_
 
TH2F * dedxVsp
 
TH2F * digiOccupancyMapEB_
 
TH2F * digiOccupancyMapEEM_
 
TH2F * digiOccupancyMapEEP_
 
TH1F * digisEcalNumHistEB_
 
TH1F * digisEcalNumHistEE_
 
bool doGenPlots_
 
bool doHLTPlots_
 
bool doRecoPlots_
 
bool doSimDigiPlots_
 
bool doSimTrackPlots_
 
edm::EDGetTokenT< EBDigiCollectionEBDigiCollectionToken_
 
edm::EDGetTokenT< edm::PCaloHitContainerebSimHitToken_
 
edm::EDGetTokenT< EEDigiCollectionEEDigiCollectionToken_
 
edm::EDGetTokenT< edm::PCaloHitContainereeSimHitToken_
 
TH1F * efficiencyRPCRecHitSimDigis_
 
TH1F * h_genhscp_met
 
TH1F * h_genhscp_met_nohscp
 
TH1F * h_genhscp_scaloret
 
TH1F * h_genhscp_scaloret_nohscp
 
TH1F * hltjet
 
TH1F * hltmet
 
TH1F * hltmu
 
TH1F * particleBetaHist_
 
TH1F * particleBetaInverseHist_
 
TH1F * particleEtaHist_
 
std::vector< int > particleIds_
 
std::map< int, int > particleIdsFoundMap_
 
TH1F * particleMassHist_
 
TH1F * particlePhiHist_
 
TH1F * particlePHist_
 
TH1F * particlePtHist_
 
int particleStatus_
 
TH1F * particleStatusHist_
 
TH2F * RecoHSCPPtVsGenPt
 
TH1F * residualsRPCRecHitSimDigis_
 
TH1F * rpcBXBarrel_ [6]
 
TH1F * rpcBXEndCap_ [3]
 
edm::ESHandle< RPCGeometryrpcGeo
 
edm::EDGetTokenT< RPCRecHitCollectionrpcRecHitsToken_
 
TH1F * rpcTimeOfFlightBarrel_ [6]
 
TH1F * rpcTimeOfFlightEndCap_ [3]
 
TH1F * simHitsEcalDigiMatchEnergyHistEB_
 
TH1F * simHitsEcalDigiMatchEnergyHistEE_
 
TH2F * simHitsEcalDigiMatchEnergyVsTimeHistEB_
 
TH2F * simHitsEcalDigiMatchEnergyVsTimeHistEE_
 
TH1F * simHitsEcalDigiMatchIEtaHist_
 
TH1F * simHitsEcalDigiMatchIPhiHist_
 
TH1F * simHitsEcalDigiMatchTimeHistEB_
 
TH1F * simHitsEcalDigiMatchTimeHistEE_
 
TH1F * simHitsEcalEnergyHistEB_
 
TH1F * simHitsEcalEnergyHistEE_
 
TH2F * simHitsEcalEnergyVsTimeHistEB_
 
TH2F * simHitsEcalEnergyVsTimeHistEE_
 
TH1F * simHitsEcalNumHistEB_
 
TH1F * simHitsEcalNumHistEE_
 
TH1F * simHitsEcalTimeHistEB_
 
TH1F * simHitsEcalTimeHistEE_
 
TH1F * simTrackParticleBetaHist_
 
TH1F * simTrackParticleEtaHist_
 
TH1F * simTrackParticlePhiHist_
 
TH1F * simTrackParticlePHist_
 
TH1F * simTrackParticlePtHist_
 
edm::EDGetTokenT< edm::SimTrackContainersimTracksToken_
 
edm::EDGetTokenT< edm::SimTrackContainersimTrackToken_
 
edm::EDGetTokenT< reco::TrackCollectiontkTracksToken_
 
edm::EDGetTokenT< edm::HepMCProducttoken_
 
edm::EDGetTokenT< trigger::TriggerEventtrEvToken_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResultsToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 47 of file HSCPValidator.h.

Constructor & Destructor Documentation

HSCPValidator::HSCPValidator ( const edm::ParameterSet iConfig)
explicit

Definition at line 98 of file HSCPValidator.cc.

References cluSizeDistribution_, dedxVsp, digiOccupancyMapEB_, digiOccupancyMapEEM_, digiOccupancyMapEEP_, digisEcalNumHistEB_, digisEcalNumHistEE_, efficiencyRPCRecHitSimDigis_, h_genhscp_met, h_genhscp_met_nohscp, h_genhscp_scaloret, h_genhscp_scaloret_nohscp, hltjet, hltmet, hltmu, TFileService::make(), particleBetaHist_, particleBetaInverseHist_, particleEtaHist_, particleMassHist_, particlePhiHist_, particlePHist_, particlePtHist_, particleStatusHist_, RecoHSCPPtVsGenPt, residualsRPCRecHitSimDigis_, rpcBXBarrel_, rpcBXEndCap_, rpcTimeOfFlightBarrel_, rpcTimeOfFlightEndCap_, simHitsEcalDigiMatchEnergyHistEB_, simHitsEcalDigiMatchEnergyHistEE_, simHitsEcalDigiMatchEnergyVsTimeHistEB_, simHitsEcalDigiMatchEnergyVsTimeHistEE_, simHitsEcalDigiMatchIEtaHist_, simHitsEcalDigiMatchIPhiHist_, simHitsEcalDigiMatchTimeHistEB_, simHitsEcalDigiMatchTimeHistEE_, simHitsEcalEnergyHistEB_, simHitsEcalEnergyHistEE_, simHitsEcalEnergyVsTimeHistEB_, simHitsEcalEnergyVsTimeHistEE_, simHitsEcalNumHistEB_, simHitsEcalNumHistEE_, simHitsEcalTimeHistEB_, simHitsEcalTimeHistEE_, simTrackParticleBetaHist_, simTrackParticleEtaHist_, simTrackParticlePhiHist_, simTrackParticlePHist_, and simTrackParticlePtHist_.

98  :
99  doGenPlots_ (iConfig.getParameter<bool>("MakeGenPlots")),
100  doHLTPlots_ (iConfig.getParameter<bool>("MakeHLTPlots")),
101  doSimTrackPlots_ (iConfig.getParameter<bool>("MakeSimTrackPlots")),
102  doSimDigiPlots_ (iConfig.getParameter<bool>("MakeSimDigiPlots")),
103  doRecoPlots_ (iConfig.getParameter<bool>("MakeRecoPlots")),
104  token_(consumes<edm::HepMCProduct> (iConfig.getParameter<edm::InputTag>("generatorLabel"))),
105  simTracksToken_(consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits"))),
106  trEvToken_(consumes<trigger::TriggerEvent>(edm::InputTag("hltTriggerSummaryAOD"))),
107  tkTracksToken_(consumes<reco::TrackCollection>(edm::InputTag("generalTracks"))),
109  rpcRecHitsToken_(consumes<RPCRecHitCollection>(edm::InputTag("rpcRecHits"))),
110  triggerResultsToken_(consumes<edm::TriggerResults>(edm::InputTag("TriggerResults", "", "HLT"))),
111  particleIds_ (iConfig.getParameter< std::vector<int> >("particleIds")),
112  particleStatus_ (iConfig.getUntrackedParameter<int>("particleStatus",1)),
113  ebSimHitToken_ (consumes<edm::PCaloHitContainer>(iConfig.getParameter<edm::InputTag>("EBSimHitCollection"))),
114  eeSimHitToken_ (consumes<edm::PCaloHitContainer>(iConfig.getParameter<edm::InputTag>("EESimHitCollection"))),
115  simTrackToken_ (consumes<edm::SimTrackContainer>(iConfig.getParameter<edm::InputTag>("SimTrackCollection"))),
116  EBDigiCollectionToken_ (consumes<EBDigiCollection>(iConfig.getParameter<edm::InputTag>("EBDigiCollection"))),
117  EEDigiCollectionToken_ (consumes<EEDigiCollection>(iConfig.getParameter<edm::InputTag>("EEDigiCollection")))
118 {
119  //now do what ever initialization is needed
120  // GEN
121  particleEtaHist_ = fileService->make<TH1F>("particleEta","Eta of gen particle",100,-5,5);
122  particlePhiHist_ = fileService->make<TH1F>("particlePhi","Phi of gen particle",180,-3.15,3.15);
123  particlePHist_ = fileService->make<TH1F>("particleP","Momentum of gen particle",500,0,2000);
124  particlePtHist_ = fileService->make<TH1F>("particlePt","P_{T} of gen particle",500,0,2000);
125  particleMassHist_ = fileService->make<TH1F>("particleMass","Mass of gen particle",1000,0,2000);
126  particleStatusHist_ = fileService->make<TH1F>("particleStatus","Status of gen particle",10,0,10);
127  particleBetaHist_ = fileService->make<TH1F>("particleBeta","Beta of gen particle",100,0,1);
128  particleBetaInverseHist_ = fileService->make<TH1F>("particleBetaInverse","1/#beta of gen particle",100,0,5);
129 
130  h_genhscp_met = fileService->make<TH1F>( "hscp_met" , "missing E_{T} hscp" , 100, 0., 1500. );
131  h_genhscp_met_nohscp = fileService->make<TH1F>( "hscp_met_nohscp" , "missing E_{T} w/o hscp" , 100, 0., 1500. );
132  h_genhscp_scaloret = fileService->make<TH1F>( "hscp_scaloret" , "scalor E_{T} sum" , 100, 0., 1500. );
133  h_genhscp_scaloret_nohscp = fileService->make<TH1F>( "hscp_scaloret_nohscp" , "scalor E_{T} sum w/o hscp" , 100, 0., 1500. );
134 
135 
136 
137 
138  //SIM track Info
139  simTrackParticleEtaHist_ = fileService->make<TH1F>("simTrackParticleEta","Eta of simTrackParticle",100,-5,5);
140  simTrackParticlePhiHist_ = fileService->make<TH1F>("simTrackParticlePhi","Phi of simTrackParticle",180,-3.15,3.15);
141  simTrackParticlePHist_ = fileService->make<TH1F>("simTrackParticleP","Momentum of simTrackParticle",500,0,2000);
142  simTrackParticlePtHist_ = fileService->make<TH1F>("simTrackParticlePt","P_{T} of simTrackParticle",500,0,2000);
143  simTrackParticleBetaHist_ = fileService->make<TH1F>("simTrackParticleBeta","Beta of simTrackParticle",100,0,1);
144 //reco track Info
145 
146  RecoHSCPPtVsGenPt= fileService->make<TH2F>("Recovsgenpt","RecovsGen",100,0,1000,100,0,1000);
147  dedxVsp = fileService->make<TH2F>("dedxvsp","dedxvsp",100,0,1000,100,0,10);
148 //HLT Info
149  hltmet = fileService->make<TH1F>("HLT_MET","MET",3,-1,2);
150  hltjet = fileService->make<TH1F>("HLT_JET","JET",3,-1,2);
151  hltmu = fileService->make<TH1F>("HLT_Mu","Mu",3,-1,2);
152 
153 
154  // SIM-DIGI: ECAL
155  simHitsEcalEnergyHistEB_ = fileService->make<TH1F>("ecalEnergyOfSimHitsEB","HSCP SimTrack-matching SimHit energy EB [GeV]",125,-1,4);
156  simHitsEcalEnergyHistEE_ = fileService->make<TH1F>("ecalEnergyOfSimHitsEE","HSCP SimTrack-matching SimHit energy EE [GeV]",125,-1,4);
157  simHitsEcalTimeHistEB_ = fileService->make<TH1F>("ecalTimingOfSimHitsEB","HSCP SimTrack-matching SimHit time EB [ns]",115,-15,100);
158  simHitsEcalTimeHistEE_ = fileService->make<TH1F>("ecalTimingOfSimHitsEE","HSCP SimTrack-matching SimHit time EE [ns]",115,-15,100);
159  simHitsEcalNumHistEB_ = fileService->make<TH1F>("ecalNumberOfSimHitsEB","Number of HSCP SimTrack-matching EB sim hits in event",100,0,200);
160  simHitsEcalNumHistEE_ = fileService->make<TH1F>("ecalNumberOfSimHitsEE","Number of HSCP SimTrack-matching EE sim hits in event",100,0,200);
161  simHitsEcalEnergyVsTimeHistEB_ = fileService->make<TH2F>("ecalEnergyVsTimeOfSimHitsEB","Energy vs. time of HSCP SimTrack-matching EB sim hits in event",115,-15,100,125,-1,4);
162  simHitsEcalEnergyVsTimeHistEE_ = fileService->make<TH2F>("ecalEnergyVsTimeOfSimHitsEE","Energy vs. time of HSCP SimTrack-matching EE sim hits in event",115,-15,100,125,-1,4);
163  simHitsEcalDigiMatchEnergyHistEB_ = fileService->make<TH1F>("ecalEnergyOfDigiMatSimHitsEB","HSCP digi-matching SimHit energy EB [GeV]",125,-1,4);
164  simHitsEcalDigiMatchEnergyHistEE_ = fileService->make<TH1F>("ecalEnergyOfDigiMatSimHitsEE","HSCP digi-matching SimHit energy EE [GeV]",125,-1,4);
165  simHitsEcalDigiMatchTimeHistEB_ = fileService->make<TH1F>("ecalTimingOfDigiMatSimHitsEB","HSCP digi-matching SimHit time EB [ns]",115,-15,100);
166  simHitsEcalDigiMatchTimeHistEE_ = fileService->make<TH1F>("ecalTimingOfDigiMatSimHitsEE","HSCP digi-matching SimHit time EE [ns]",115,-15,100);
167  simHitsEcalDigiMatchEnergyVsTimeHistEB_ = fileService->make<TH2F>("ecalEnergyVsTimeOfDigiMatSimHitsEB","HSCP digi-matching EB SimHit energy vs. time",115,-15,100,125,-1,4);
168  simHitsEcalDigiMatchEnergyVsTimeHistEE_ = fileService->make<TH2F>("ecalEnergyVsTimeOfDigiMatSimHitsEE","HSCP digi-matching EE SimHit energy vs. time",115,-15,100,125,-1,4);
169  simHitsEcalDigiMatchIEtaHist_ = fileService->make<TH1F>("ecalIEtaOfDigiMatchSimHits","iEta of digi-matching Ecal simHits (EB)",171,-85,86);
170  simHitsEcalDigiMatchIPhiHist_ = fileService->make<TH1F>("ecalIPhiOfDigiMatchSimHits","iPhi of digi-matching Ecal simHits (EB)",360,1,361);
171  digisEcalNumHistEB_ = fileService->make<TH1F>("ecalDigisNumberEB","Number of EB digis matching simhits in event",200,0,1000);
172  digisEcalNumHistEE_ = fileService->make<TH1F>("ecalDigisNumberEE","Number of EE digis matching simhits in event",200,0,1000);
173  digiOccupancyMapEB_ = fileService->make<TH2F>("ecalDigiOccupancyMapEB","Occupancy of simhit-matching digis EB;i#phi;i#eta",360,1,361,171,-85,86);
174  digiOccupancyMapEEP_ = fileService->make<TH2F>("ecalDigiOccupancyMapEEM","Occupancy of simhit-matching digis EEM;ix;iy",100,1,100,100,1,100);
175  digiOccupancyMapEEM_ = fileService->make<TH2F>("ecalDigiOccupancyMapEEP","Occupancy of simhit-matching digis EEP;ix;iy",100,1,100,100,1,100);
176 
177  // SIM-DIGI: RPC
178  residualsRPCRecHitSimDigis_ = fileService->make<TH1F>("residualsRPCRecHitSimDigis","HSCP SimHit - Clossest RPC RecHit",100,-5,5);
179  efficiencyRPCRecHitSimDigis_ = fileService->make<TH1F>("efficiencyRPCRecHitSimDigis","HSCP SimHits RecHits Efficiency",2,-0.5,1.5);
180  cluSizeDistribution_ = fileService->make<TH1F>("RPCCluSizeDistro","RPC HSCP CluSize Distribution",11,-0.5,10.5);
181  rpcTimeOfFlightBarrel_[0] = fileService->make<TH1F>("RPCToFLayer1","RPC HSCP Time Of Flight Layer 1",50,5,100);
182  rpcTimeOfFlightBarrel_[1] = fileService->make<TH1F>("RPCToFLayer2","RPC HSCP Time Of Flight Layer 2",50,5,100);
183  rpcTimeOfFlightBarrel_[2] = fileService->make<TH1F>("RPCToFLayer3","RPC HSCP Time Of Flight Layer 3",50,5,100);
184  rpcTimeOfFlightBarrel_[3] = fileService->make<TH1F>("RPCToFLayer4","RPC HSCP Time Of Flight Layer 4",50,5,100);
185  rpcTimeOfFlightBarrel_[4] = fileService->make<TH1F>("RPCToFLayer5","RPC HSCP Time Of Flight Layer 5",50,5,100);
186  rpcTimeOfFlightBarrel_[5] = fileService->make<TH1F>("RPCToFLayer6","RPC HSCP Time Of Flight Layer 6",50,5,100);
187  rpcBXBarrel_[0] = fileService->make<TH1F>("RPCBXLayer1","RPC HSCP BX Layer 1",5,-0.5,4.5);
188  rpcBXBarrel_[1] = fileService->make<TH1F>("RPCBXLayer2","RPC HSCP BX Layer 2",5,-0.5,4.5);
189  rpcBXBarrel_[2] = fileService->make<TH1F>("RPCBXLayer3","RPC HSCP BX Layer 3",5,-0.5,4.5);
190  rpcBXBarrel_[3] = fileService->make<TH1F>("RPCBXLayer4","RPC HSCP BX Layer 4",5,-0.5,4.5);
191  rpcBXBarrel_[4] = fileService->make<TH1F>("RPCBXLayer5","RPC HSCP BX Layer 5",5,-0.5,4.5);
192  rpcBXBarrel_[5] = fileService->make<TH1F>("RPCBXLayer6","RPC HSCP BX Layer 6",5,-0.5,4.5);
193  rpcTimeOfFlightEndCap_[0]= fileService->make<TH1F>("RPCToFDisk1","RPC HSCP Time Of Flight Disk 1",50,5,100);
194  rpcTimeOfFlightEndCap_[1]= fileService->make<TH1F>("RPCToFDisk2","RPC HSCP Time Of Flight Disk 2",50,5,100);
195  rpcTimeOfFlightEndCap_[2]= fileService->make<TH1F>("RPCToFDisk3","RPC HSCP Time Of Flight Disk 3",50,5,100);
196  rpcBXEndCap_[0] = fileService->make<TH1F>("RPCBXDisk1","RPC HSCP BX Disk 1",5,-0.5,4.5);
197  rpcBXEndCap_[1] = fileService->make<TH1F>("RPCBXDisk2","RPC HSCP BX Disk 2",5,-0.5,4.5);
198  rpcBXEndCap_[2] = fileService->make<TH1F>("RPCBXDisk3","RPC HSCP BX Disk 3",5,-0.5,4.5);
199 }
bool doSimDigiPlots_
Definition: HSCPValidator.h:69
T getParameter(std::string const &) const
TH1F * particleMassHist_
Definition: HSCPValidator.h:87
TH2F * simHitsEcalDigiMatchEnergyVsTimeHistEE_
T getUntrackedParameter(std::string const &, T const &) const
TH1F * rpcTimeOfFlightBarrel_[6]
edm::EDGetTokenT< EEDigiCollection > EEDigiCollectionToken_
TH1F * rpcTimeOfFlightEndCap_[3]
TH1F * simHitsEcalTimeHistEE_
edm::EDGetTokenT< EBDigiCollection > EBDigiCollectionToken_
edm::EDGetTokenT< edm::PCaloHitContainer > eeSimHitToken_
TH1F * particlePhiHist_
Definition: HSCPValidator.h:84
TH2F * simHitsEcalEnergyVsTimeHistEB_
TH1F * simHitsEcalEnergyHistEE_
TH1F * h_genhscp_met_nohscp
Definition: HSCPValidator.h:92
edm::EDGetTokenT< edm::PCaloHitContainer > ebSimHitToken_
TH1F * digisEcalNumHistEE_
TH1F * particleBetaHist_
Definition: HSCPValidator.h:89
TH2F * digiOccupancyMapEEM_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
TH1F * cluSizeDistribution_
TH1F * simHitsEcalDigiMatchTimeHistEB_
std::vector< int > particleIds_
Definition: HSCPValidator.h:80
TH1F * simTrackParticlePtHist_
TH1F * particleEtaHist_
Definition: HSCPValidator.h:83
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::SimTrackContainer > simTracksToken_
Definition: HSCPValidator.h:74
TH1F * simHitsEcalNumHistEE_
TH2F * digiOccupancyMapEEP_
TH1F * particlePtHist_
Definition: HSCPValidator.h:86
TH1F * h_genhscp_scaloret
Definition: HSCPValidator.h:93
TH2F * digiOccupancyMapEB_
TH1F * efficiencyRPCRecHitSimDigis_
TH2F * simHitsEcalDigiMatchEnergyVsTimeHistEB_
TH1F * simHitsEcalDigiMatchEnergyHistEE_
TH1F * h_genhscp_scaloret_nohscp
Definition: HSCPValidator.h:94
edm::EDGetTokenT< edm::HepMCProduct > token_
Definition: HSCPValidator.h:73
TH1F * simHitsEcalDigiMatchTimeHistEE_
edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken_
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitsToken_
Definition: HSCPValidator.h:78
TH2F * simHitsEcalEnergyVsTimeHistEE_
TH1F * rpcBXBarrel_[6]
TH1F * residualsRPCRecHitSimDigis_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
Definition: HSCPValidator.h:79
TH1F * simHitsEcalDigiMatchIEtaHist_
TH1F * rpcBXEndCap_[3]
TH1F * simHitsEcalNumHistEB_
edm::Service< TFileService > fileService
TH1F * digisEcalNumHistEB_
edm::EDGetTokenT< trigger::TriggerEvent > trEvToken_
Definition: HSCPValidator.h:75
TH1F * simTrackParticleEtaHist_
Definition: HSCPValidator.h:98
bool doSimTrackPlots_
Definition: HSCPValidator.h:68
TH1F * simHitsEcalDigiMatchIPhiHist_
TH1F * simHitsEcalDigiMatchEnergyHistEB_
TH1F * particleStatusHist_
Definition: HSCPValidator.h:88
TH1F * particlePHist_
Definition: HSCPValidator.h:85
TH1F * h_genhscp_met
Definition: HSCPValidator.h:91
TH2F * RecoHSCPPtVsGenPt
TH1F * simTrackParticlePhiHist_
Definition: HSCPValidator.h:99
edm::EDGetTokenT< reco::TrackCollection > tkTracksToken_
Definition: HSCPValidator.h:76
TH1F * simTrackParticleBetaHist_
edm::EDGetTokenT< edm::ValueMap< reco::DeDxData > > dEdxTrackToken_
Definition: HSCPValidator.h:77
TH1F * simHitsEcalEnergyHistEB_
TH1F * simTrackParticlePHist_
TH1F * particleBetaInverseHist_
Definition: HSCPValidator.h:90
TH1F * simHitsEcalTimeHistEB_
HSCPValidator::~HSCPValidator ( )
override

Definition at line 202 of file HSCPValidator.cc.

203 {
204 
205  // do anything here that needs to be done at desctruction time
206  // (e.g. close files, deallocate resources etc.)
207 // particleEtaHist_ = fileService->make<TH1F>("particleEta","Eta of gen particle",100,-5,5);
208 // particlePhiHist_ = fileService->make<TH1F>("particlePhi","Phi of gen particle",180,-3.15,3.15);
209 // particlePHist_ = fileService->make<TH1F>("particleP","Momentum of gen particle",500,0,2000);
210 // particlePtHist_ = fileService->make<TH1F>("particlePt","P_{T} of gen particle",500,0,2000);
211 // particleMassHist_ = fileService->make<TH1F>("particleMass","Mass of gen particle",1000,0,2000);
212 // particleStatusHist_ = fileService->make<TH1F>("particleStatus","Status of gen particle",10,0,10);
213 // particleBetaHist_ = fileService->make<TH1F>("particleBeta","Beta of gen particle",100,0,1);
214 // particleBetaInverseHist_ = fileService->make<TH1F>("particleBetaInverse","1/#beta of gen particle",100,0,5);
215 
216 }

Member Function Documentation

void HSCPValidator::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 225 of file HSCPValidator.cc.

References doGenPlots_, doHLTPlots_, doRecoPlots_, doSimDigiPlots_, doSimTrackPlots_, edm::EventSetup::get(), makeGenPlots(), makeHLTPlots(), makeRecoPlots(), makeSimDigiPlotsECAL(), makeSimDigiPlotsRPC(), makeSimTrackPlots(), and rpcGeo.

226 {
227  using namespace edm;
228  iSetup.get<MuonGeometryRecord>().get(rpcGeo);
229 
230 
231  if(doGenPlots_)
232  makeGenPlots(iEvent);
233  if(doSimTrackPlots_)
234  makeSimTrackPlots(iEvent);
235  if(doSimDigiPlots_){
236  makeSimDigiPlotsECAL(iEvent);
237  makeSimDigiPlotsRPC(iEvent);
238  }
239  if(doHLTPlots_){
240  makeHLTPlots(iEvent);
241  }
242  if(doRecoPlots_){
243  makeRecoPlots(iEvent);
244  }
245 }
bool doSimDigiPlots_
Definition: HSCPValidator.h:69
void makeSimTrackPlots(const edm::Event &iEvent)
void makeRecoPlots(const edm::Event &iEvent)
void makeSimDigiPlotsECAL(const edm::Event &iEvent)
void makeGenPlots(const edm::Event &iEvent)
bool doSimTrackPlots_
Definition: HSCPValidator.h:68
HLT enums.
edm::ESHandle< RPCGeometry > rpcGeo
T get() const
Definition: EventSetup.h:71
void makeSimDigiPlotsRPC(const edm::Event &iEvent)
void makeHLTPlots(const edm::Event &iEvent)
void HSCPValidator::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 250 of file HSCPValidator.cc.

251 {
252 }
void HSCPValidator::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 256 of file HSCPValidator.cc.

References gather_cfg::cout, intToString(), particleIdsFoundMap_, and AlCaHLTBitMon_QueryRunRegistry::string.

257 {
258  std::string frequencies = "";
259  for(std::map<int,int>::const_iterator itr = particleIdsFoundMap_.begin();
260  itr != particleIdsFoundMap_.end(); ++itr)
261  {
262  frequencies+="PDG ID: ";
263  frequencies+=intToString(itr->first);
264  frequencies+=" Frequency: ";
265  frequencies+=intToString(itr->second);
266  frequencies+="\n";
267  }
268  std::cout << "Found PDGIds: " << "\n\n" << frequencies << std::endl;
269 
270 }
std::map< int, int > particleIdsFoundMap_
Definition: HSCPValidator.h:82
std::string intToString(int num)
bool HSCPValidator::IncreasedTreshold ( const trigger::TriggerEvent trEv,
const edm::InputTag InputPath,
double  NewThreshold,
double  etaCut,
int  NObjectAboveThreshold,
bool  averageThreshold 
)
private

Definition at line 847 of file HSCPValidator.cc.

References Average, DEFINE_FWK_MODULE, PVValHelper::eta, fftjetproducer_cfi::etaCut, trigger::TriggerEvent::filterIds(), trigger::TriggerEvent::filterIndex(), trigger::TriggerEvent::filterKeys(), trigger::TriggerEvent::getObjects(), mps_fire::i, SiStripPI::max, gen::n, EnergyCorrector::pt, and trigger::TriggerEvent::sizeFilters().

Referenced by makeHLTPlots().

848 {
849  unsigned int filterIndex = trEv.filterIndex(InputPath);
850  //if(filterIndex<trEv.sizeFilters())printf("SELECTED INDEX =%i --> %s XXX %s\n",filterIndex,trEv.filterTag(filterIndex).label().c_str(), trEv.filterTag(filterIndex).process().c_str());
851 
852  if (filterIndex<trEv.sizeFilters()){
853  const trigger::Vids& VIDS(trEv.filterIds(filterIndex));
854  const trigger::Keys& KEYS(trEv.filterKeys(filterIndex));
855  const int nI(VIDS.size());
856  const int nK(KEYS.size());
857  assert(nI==nK);
858  const int n(std::max(nI,nK));
859  const trigger::TriggerObjectCollection& TOC(trEv.getObjects());
860 
861 
862  if(!averageThreshold){
863  int NObjectAboveThresholdObserved = 0;
864  for (int i=0; i!=n; ++i) {
865  if(TOC[KEYS[i]].pt()> NewThreshold && fabs(TOC[KEYS[i]].eta())<etaCut) NObjectAboveThresholdObserved++;
866  //cout << " " << i << " " << VIDS[i] << "/" << KEYS[i] << ": "<< TOC[KEYS[i]].id() << " " << TOC[KEYS[i]].pt() << " " << TOC[KEYS[i]].eta() << " " << TOC[KEYS[i]].phi() << " " << TOC[KEYS[i]].mass()<< endl;
867  }
868  if(NObjectAboveThresholdObserved>=NObjectAboveThreshold)return true;
869 
870  }else{
871  std::vector<double> ObjPt;
872 
873  for (int i=0; i!=n; ++i) {
874  ObjPt.push_back(TOC[KEYS[i]].pt());
875  //cout << " " << i << " " << VIDS[i] << "/" << KEYS[i] << ": "<< TOC[KEYS[i]].id() << " " << TOC[KEYS[i]].pt() << " " << TOC[KEYS[i]].eta() << " " << TOC[KEYS[i]].phi() << " " << TOC[KEYS[i]].mass()<< endl;
876  }
877  if((int)(ObjPt.size())<NObjectAboveThreshold)return false;
878  std::sort(ObjPt.begin(), ObjPt.end());
879 
880  double Average = 0;
881  for(int i=0; i<NObjectAboveThreshold;i++){
882  Average+= ObjPt[ObjPt.size()-1-i];
883  }Average/=NObjectAboveThreshold;
884  //cout << "AVERAGE = " << Average << endl;
885 
886  if(Average>NewThreshold)return true;
887  }
888  }
889  return false;
890 }
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:135
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:123
const Vids & filterIds(trigger::size_type index) const
Definition: TriggerEvent.h:110
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
std::vector< size_type > Keys
std::vector< int > Vids
std::string HSCPValidator::intToString ( int  num)
private

Definition at line 834 of file HSCPValidator.cc.

Referenced by endJob().

835 {
836  using namespace std;
837  ostringstream myStream;
838  myStream << num << flush;
839  return(myStream.str()); //returns the string form of the stringstream object
840 }
void HSCPValidator::makeGenPlots ( const edm::Event iEvent)
private

Definition at line 273 of file HSCPValidator.cc.

References funct::abs(), spr::find(), edm::Event::getByToken(), edm::HepMCProduct::GetEvent(), h_genhscp_met, h_genhscp_met_nohscp, h_genhscp_scaloret, h_genhscp_scaloret_nohscp, mag(), AlCaHLTBitMon_ParallelJobs::p, particleBetaHist_, particleBetaInverseHist_, particleEtaHist_, particleIds_, particleIdsFoundMap_, particleMassHist_, particlePhiHist_, particlePHist_, particlePtHist_, particleStatus_, particleStatusHist_, funct::pow(), mathSSE::sqrt(), and token_.

Referenced by analyze().

274 {
275  using namespace edm;
276 
277  double missingpx=0;
278  double missingpy=0;
279  double missingpx_nohscp=0;
280  double missingpy_nohscp=0;
281  double scalorEt=0;
282  double scalorEt_nohscp=0;
283 
284 
286  iEvent.getByToken(token_, evt);
287 
288  HepMC::GenEvent * myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
289  for(HepMC::GenEvent::particle_iterator p = myGenEvent->particles_begin();
290  p != myGenEvent->particles_end(); ++p )
291  {
292 
293  if((*p)->status() != particleStatus_)
294  continue;
295  //calculate MET(neutrino as MET)
296  if(abs((*p)->pdg_id())!=12 && abs((*p)->pdg_id())!=14 && abs((*p)->pdg_id())!=16){ //for non-neutrino particles.
297  missingpx-=(*p)->momentum().px();
298  missingpy-=(*p)->momentum().py();
299  scalorEt+=(*p)->momentum().perp();
300  }
301 
302  // Check if the particleId is in our R-hadron list
303  std::vector<int>::const_iterator partIdItr = find(particleIds_.begin(),particleIds_.end(),(*p)->pdg_id());
304  if(partIdItr==particleIds_.end()){
305 
306  //calculate MET(neutrino+ HSCP as MET)
307  if(abs((*p)->pdg_id())!=12 && abs((*p)->pdg_id())!=14 && abs((*p)->pdg_id())!=16){ //for non-neutrino particles.
308  missingpx_nohscp-=(*p)->momentum().px();
309  missingpy_nohscp-=(*p)->momentum().py();
310  scalorEt_nohscp+=(*p)->momentum().perp();
311  }
312  }
313  else{
314 
315  particleStatusHist_->Fill((*p)->status());
316 
317  std::pair<std::map<int,int>::iterator,bool> pair = particleIdsFoundMap_.insert(std::make_pair<int,int>((*p)->pdg_id(),1));
318  if(!pair.second)
319  {
320  ++(pair.first->second);
321  }
322 
323  double mag = sqrt(pow((*p)->momentum().px(),2) + pow((*p)->momentum().py(),2) + pow((*p)->momentum().pz(),2) );
324  particleEtaHist_->Fill((*p)->momentum().eta());
325  particlePhiHist_->Fill((*p)->momentum().phi());
326  particlePHist_->Fill(mag);
327  particlePtHist_->Fill((*p)->momentum().perp());
328  particleMassHist_->Fill((*p)->generated_mass());
329  float particleP = mag;
330  float particleM = (*p)->generated_mass();
331  particleBetaHist_->Fill(particleP/sqrt(particleP*particleP+particleM*particleM));
332  particleBetaInverseHist_->Fill(sqrt(particleP*particleP+particleM*particleM)/particleP);
333  }
334 
335  }
336 
337  h_genhscp_met->Fill(sqrt(missingpx*missingpx+missingpy*missingpy));
338  h_genhscp_met_nohscp->Fill(sqrt(missingpx_nohscp*missingpx_nohscp+missingpy_nohscp*missingpy_nohscp));
339  h_genhscp_scaloret->Fill(scalorEt);
340  h_genhscp_scaloret_nohscp->Fill(scalorEt_nohscp);
341 
342 
343  delete myGenEvent;
344 
345 
346 
347 }
TH1F * particleMassHist_
Definition: HSCPValidator.h:87
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
TH1F * particlePhiHist_
Definition: HSCPValidator.h:84
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
TH1F * h_genhscp_met_nohscp
Definition: HSCPValidator.h:92
TH1F * particleBetaHist_
Definition: HSCPValidator.h:89
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< int > particleIds_
Definition: HSCPValidator.h:80
std::map< int, int > particleIdsFoundMap_
Definition: HSCPValidator.h:82
TH1F * particleEtaHist_
Definition: HSCPValidator.h:83
TH1F * particlePtHist_
Definition: HSCPValidator.h:86
TH1F * h_genhscp_scaloret
Definition: HSCPValidator.h:93
T sqrt(T t)
Definition: SSEVec.h:18
TH1F * h_genhscp_scaloret_nohscp
Definition: HSCPValidator.h:94
edm::EDGetTokenT< edm::HepMCProduct > token_
Definition: HSCPValidator.h:73
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:38
TH1F * particleStatusHist_
Definition: HSCPValidator.h:88
TH1F * particlePHist_
Definition: HSCPValidator.h:85
TH1F * h_genhscp_met
Definition: HSCPValidator.h:91
HLT enums.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
TH1F * particleBetaInverseHist_
Definition: HSCPValidator.h:90
void HSCPValidator::makeHLTPlots ( const edm::Event iEvent)
private

Definition at line 377 of file HSCPValidator.cc.

References edm::TriggerResultsByName::accept(), gather_cfg::cout, edm::Event::getByToken(), hltjet, hltmet, hltmu, mps_fire::i, IncreasedTreshold(), edm::TriggerResultsByName::isValid(), edm::HandleBase::isValid(), edm::TriggerResultsByName::size(), trEvToken_, edm::TriggerResultsByName::triggerIndex(), edm::TriggerResultsByName::triggerName(), triggerResults, edm::Event::triggerResultsByName(), and triggerResultsToken_.

Referenced by analyze().

378 {
379  using namespace edm;
380  //get HLT infos
381 
383  iEvent.getByToken(triggerResultsToken_, triggerResults);
384 
385  edm::TriggerResultsByName tr(nullptr, nullptr);
386  if(triggerResults.isValid()) {
387  tr = iEvent.triggerResultsByName(*triggerResults);
388  }
389 
390  if(!tr.isValid()){
391  std::cout<<"Trigger Results not available"<<std::endl;
392  }
393 
395  iEvent.getByToken(trEvToken_, trEvHandle);
396  trigger::TriggerEvent trEv = *trEvHandle;
397 
398 
399  unsigned int TrIndex_Unknown = tr.size();
400 
401 
402  // HLT TRIGGER BASED ON 1 MUON!
403  if(TrIndex_Unknown != tr.triggerIndex("HLT_Mu40_v1")){
404  if(tr.accept(tr.triggerIndex("HLT_Mu40_v1"))) hltmu->Fill(1);
405  else {hltmu->Fill(0);}
406  }
407  else{
408  if(TrIndex_Unknown != tr.triggerIndex("HLT_Mu30_v1")){
409  if(IncreasedTreshold(trEv, InputTag("hltSingleMu30L3Filtered30","","HLT"), 40,2.1, 1, false)) hltmu->Fill(1);
410  else hltmu->Fill(0);
411  }else{
412  printf("BUG with HLT_Mu\n");
413  std::cout<<"trigger names are : ";
414  for(unsigned int i=0;i<tr.size();i++){
415  std::cout<<" "<<tr.triggerName(i);
416  }
417  std::cout<<std::endl;
418  }
419  }
420 
421 
422  // HLT TRIGGER BASED ON MET!
423  if(TrIndex_Unknown != tr.triggerIndex("HLT_PFMHT150_v3")){
424  if(tr.accept(tr.triggerIndex("HLT_PFMHT150_v3")))hltmet->Fill(1);
425  else hltmet->Fill(0);
426  }else{
427  if(TrIndex_Unknown != tr.triggerIndex("HLT_PFMHT150_v2")){
428  if(tr.accept(tr.triggerIndex("HLT_PFMHT150_v2"))) hltmet->Fill(1);
429  else hltmet->Fill(0);
430  }
431  else{
432  printf("BUG with HLT_MET\n");
433 
434  }
435  }
436 
437 
438  // HLT TRIGGER BASED ON 1 JET!
439  if(TrIndex_Unknown != tr.triggerIndex("HLT_Jet370_v1")){
440  if(tr.accept(tr.triggerIndex("HLT_Jet370_v1")))hltjet->Fill(1);
441  else hltjet->Fill(0);
442  }else{
443  if(TrIndex_Unknown != tr.triggerIndex("HLT_Jet100U")){
444  if(IncreasedTreshold(trEv, InputTag("hlt1jet100U","","HLT"), 140, 5.,1, false))hltjet->Fill(1);
445  else hltjet->Fill(0);
446  }else{
447  if(TrIndex_Unknown != tr.triggerIndex("HLT_Jet70U")){
448  if(IncreasedTreshold(trEv, InputTag("hlt1jet70U","","HLT"), 140, 5.,1, false))hltjet->Fill(1);
449  else hltjet->Fill(0);
450  }else{
451  if(TrIndex_Unknown != tr.triggerIndex("HLT_Jet50U")){
452  if(IncreasedTreshold(trEv, InputTag("hlt1jet50U","","HLT"), 140,2.5, 1, false))hltjet->Fill(1);
453  else hltjet->Fill(0);
454  }else{
455  printf("BUG with HLT_Jet\n");
456 
457  }
458  }
459  }
460  }
461 
462 
463 
464 
465 
466 }
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
TriggerResultsByName triggerResultsByName(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:265
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool IncreasedTreshold(const trigger::TriggerEvent &trEv, const edm::InputTag &InputPath, double NewThreshold, double etaCut, int NObjectAboveThreshold, bool averageThreshold)
static std::string const triggerResults
Definition: EdmProvDump.cc:45
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
Definition: HSCPValidator.h:79
edm::EDGetTokenT< trigger::TriggerEvent > trEvToken_
Definition: HSCPValidator.h:75
HLT enums.
void HSCPValidator::makeRecoPlots ( const edm::Event iEvent)
private

Definition at line 681 of file HSCPValidator.cc.

References dEdxTrackToken_, dedxVsp, SoftLeptonByDistance_cfi::distance, spr::find(), edm::Event::getByToken(), edm::HepMCProduct::GetEvent(), mps_fire::i, AlCaHLTBitMon_ParallelJobs::p, particleIds_, particleStatus_, funct::pow(), edm::Handle< T >::product(), RecoHSCPPtVsGenPt, mathSSE::sqrt(), tkTracksToken_, and token_.

Referenced by analyze().

682 {
683  using namespace edm;
684  using namespace reco;
685 
687  iEvent.getByToken(token_, evt);
688 
689  Handle<TrackCollection> tkTracks;
690  iEvent.getByToken(tkTracksToken_,tkTracks);
691  const reco::TrackCollection tkTC = *(tkTracks.product());
692 
693  Handle<ValueMap<DeDxData> > dEdxTrackHandle;
694  iEvent.getByToken(dEdxTrackToken_, dEdxTrackHandle);
695  const ValueMap<DeDxData> dEdxTrack = *dEdxTrackHandle.product();
696 
697  for(size_t i=0; i<tkTracks->size(); i++){
698 
699  reco::TrackRef trkRef = reco::TrackRef(tkTracks, i);
700 
701  if(trkRef->pt()<5 || trkRef->normalizedChi2()>10) continue;
702 
703  double minR= 999;
704  double hscpgenPt =-1;
705 
706  HepMC::GenEvent * myGenEvent = new HepMC::GenEvent(*(evt->GetEvent()));
707  for(HepMC::GenEvent::particle_iterator p = myGenEvent->particles_begin();
708  p != myGenEvent->particles_end(); ++p )
709  {
710 
711  if((*p)->status() != particleStatus_)
712  continue;
713  // Check if the particleId is in our R-hadron list
714  std::vector<int>::const_iterator partIdItr = find(particleIds_.begin(),particleIds_.end(),(*p)->pdg_id());
715  if(partIdItr!=particleIds_.end()){
716 
717  //calculate DeltaR
718  double distance =pow((*p)->momentum().eta()-trkRef->eta(),2)+pow((*p)->momentum().phi()-trkRef->phi(),2);
719  distance =sqrt(distance);
720  if(distance <minR ){
721  minR = distance;
722  hscpgenPt= (*p)->momentum().perp();
723  }
724  }
725  }
726  RecoHSCPPtVsGenPt->Fill(trkRef->pt(),hscpgenPt);
727 
728  delete myGenEvent;
729  double dedx = dEdxTrack[trkRef].dEdx();
730  dedxVsp->Fill( trkRef->p(),dedx);
731 
732  }
733 
734 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:15
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< int > particleIds_
Definition: HSCPValidator.h:80
T sqrt(T t)
Definition: SSEVec.h:18
edm::EDGetTokenT< edm::HepMCProduct > token_
Definition: HSCPValidator.h:73
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:38
T const * product() const
Definition: Handle.h:74
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:21
fixed size matrix
TH2F * RecoHSCPPtVsGenPt
HLT enums.
edm::EDGetTokenT< reco::TrackCollection > tkTracksToken_
Definition: HSCPValidator.h:76
edm::EDGetTokenT< edm::ValueMap< reco::DeDxData > > dEdxTrackToken_
Definition: HSCPValidator.h:77
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void HSCPValidator::makeSimDigiPlotsECAL ( const edm::Event iEvent)
private

Definition at line 469 of file HSCPValidator.cc.

References EcalMGPASample::adc(), edm::DataFrameContainer::begin(), gather_cfg::cout, digiOccupancyMapEB_, digiOccupancyMapEEM_, digiOccupancyMapEEP_, digisEcalNumHistEB_, digisEcalNumHistEE_, EBDigiCollectionToken_, ebSimHitToken_, EEDigiCollectionToken_, eeSimHitToken_, edm::DataFrameContainer::end(), spr::find(), edm::Event::getByToken(), mps_fire::i, edm::HandleBase::isValid(), particleIds_, edm::Handle< T >::product(), EcalDataFrame::sample(), simHitsEcalDigiMatchEnergyHistEB_, simHitsEcalDigiMatchEnergyHistEE_, simHitsEcalDigiMatchEnergyVsTimeHistEB_, simHitsEcalDigiMatchEnergyVsTimeHistEE_, simHitsEcalDigiMatchIEtaHist_, simHitsEcalDigiMatchIPhiHist_, simHitsEcalDigiMatchTimeHistEB_, simHitsEcalDigiMatchTimeHistEE_, simHitsEcalEnergyHistEB_, simHitsEcalEnergyHistEE_, simHitsEcalEnergyVsTimeHistEB_, simHitsEcalEnergyVsTimeHistEE_, simHitsEcalNumHistEB_, simHitsEcalNumHistEE_, simHitsEcalTimeHistEB_, simHitsEcalTimeHistEE_, muonSimHitMatcherPSet::simTrack, tkConvValidator_cfi::simTracks, simTrackToken_, EcalDataFrame::size(), and ecaldqm::zside().

Referenced by analyze().

470 {
471  using namespace edm;
472  // EB SimHits
473  Handle<PCaloHitContainer> ebSimHits;
474  iEvent.getByToken(ebSimHitToken_, ebSimHits);
475  if(!ebSimHits.isValid())
476  {
477  std::cout << "Cannot get EBSimHits from event!" << std::endl;
478  return;
479  }
480  // EE SimHits
481  Handle<PCaloHitContainer> eeSimHits;
482  iEvent.getByToken(eeSimHitToken_, eeSimHits);
483  if(!eeSimHits.isValid())
484  {
485  std::cout << "Cannot get EESimHits from event!" << std::endl;
486  return;
487  }
488  // SimTracks
490  iEvent.getByToken(simTrackToken_,simTracks);
491  if(!simTracks.isValid())
492  {
493  std::cout << "Cannot get SimTracks from event!" << std::endl;
494  return;
495  }
496  // EB Digis
497  Handle<EBDigiCollection> ebDigis;
498  iEvent.getByToken(EBDigiCollectionToken_,ebDigis);
499  if(!ebDigis.isValid())
500  {
501  std::cout << "Cannot get EBDigis from event!" << std::endl;
502  return;
503  }
504  // EE Digis
505  Handle<EEDigiCollection> eeDigis;
506  iEvent.getByToken(EEDigiCollectionToken_,eeDigis);
507  if(!eeDigis.isValid())
508  {
509  std::cout << "Cannot get EEDigis from event!" << std::endl;
510  return;
511  }
512 
513  // EB first
514  // 1) Look at SimTracks, getting only the HSCP tracks
515  // 2) Match to PCaloHits
516  // 3) Match to digis
517  int numMatchedSimHitsEventEB = 0;
518  int numMatchedDigisEventEB = 0;
519  const PCaloHitContainer* phitsEB=nullptr;
520  phitsEB = ebSimHits.product();
521  for(SimTrackContainer::const_iterator simTrack = simTracks->begin(); simTrack != simTracks->end(); ++simTrack)
522  {
523  // Check if the particleId is in our list
524  std::vector<int>::const_iterator partIdItr = find(particleIds_.begin(),particleIds_.end(),simTrack->type());
525  if(partIdItr==particleIds_.end())
526  continue;
527 
528  PCaloHitContainer mySimHitsEB;
529  std::vector<EBDataFrame> myDigisEB;
530 
531  //int particleId = simTrack->type();
532  int trackId = simTrack->trackId();
533  PCaloHitContainer::const_iterator simHitItr = phitsEB->begin();
534  while(simHitItr != phitsEB->end())
535  {
536  if(simHitItr->geantTrackId()==trackId)
537  mySimHitsEB.push_back(*simHitItr);
538  ++simHitItr;
539  }
540  if(mySimHitsEB.empty())
541  {
542  std::cout << "Could not find matching EB PCaloHits for SimTrack id: " << trackId << ". Skipping this SimTrack" << std::endl;
543  continue;
544  }
545 
546  // Loop over matching PCaloHits
547  for(simHitItr = mySimHitsEB.begin(); simHitItr != mySimHitsEB.end(); ++simHitItr)
548  {
549  simHitsEcalEnergyHistEB_->Fill(simHitItr->energy());
550  simHitsEcalTimeHistEB_->Fill(simHitItr->time());
551  simHitsEcalEnergyVsTimeHistEB_->Fill(simHitItr->time(),simHitItr->energy());
552  EBDetId simHitId = EBDetId(simHitItr->id());
553  std::cout << "SimHit DetId found: " << simHitId << " for PDGid: " << simTrack->type() << std::endl;
554  //std::cout << "SimHit hashedIndex: " << simHitId.hashedIndex() << std::endl;
555  std::cout << "SimHit energy: " << simHitItr->energy() << " time: " << simHitItr->time() << std::endl;
556  ++numMatchedSimHitsEventEB;
557 
558  EBDigiCollection::const_iterator digiItr = ebDigis->begin();
559  while(digiItr != ebDigis->end() && (digiItr->id() != simHitId))
560  ++digiItr;
561  if(digiItr==ebDigis->end())
562  {
563  // Commented out for debugging ease, Aug 3 2009
564  std::cout << "Could not find simHit detId: " << simHitId << "in EBDigiCollection!" << std::endl;
565  continue;
566  }
567  std::vector<EBDataFrame>::const_iterator myDigiItr = myDigisEB.begin();
568  while(myDigiItr != myDigisEB.end() && (digiItr->id() != myDigiItr->id()))
569  ++myDigiItr;
570  if(myDigiItr!=myDigisEB.end())
571  continue; // if this digi is already in the list, skip it
572 
573  ++numMatchedDigisEventEB;
574  EBDataFrame df = *digiItr;
575  myDigisEB.push_back(df);
576  std::cout << "SAMPLE ADCs: " << "\t";
577  for(int i=0; i<10;++i)
578  std::cout << i << "\t";
579  std::cout << std::endl << "\t\t";
580  for(int i=0; i < df.size(); ++i)
581  {
582  std::cout << df.sample(i).adc() << "\t";
583  }
584  std::cout << std::endl << std::endl;
585 
586  simHitsEcalDigiMatchEnergyHistEB_->Fill(simHitItr->energy());
587  simHitsEcalDigiMatchTimeHistEB_->Fill(simHitItr->time());
588  simHitsEcalDigiMatchEnergyVsTimeHistEB_->Fill(simHitItr->time(),simHitItr->energy());
589  simHitsEcalDigiMatchIEtaHist_->Fill(((EBDetId)digiItr->id()).ieta());
590  simHitsEcalDigiMatchIPhiHist_->Fill(((EBDetId)digiItr->id()).iphi());
591  digiOccupancyMapEB_->Fill(((EBDetId)digiItr->id()).iphi(),((EBDetId)digiItr->id()).ieta());
592  }
593  }
594  simHitsEcalNumHistEB_->Fill(numMatchedSimHitsEventEB);
595  digisEcalNumHistEB_->Fill(numMatchedDigisEventEB);
596 
597  // EE next
598  int numMatchedSimHitsEventEE = 0;
599  int numMatchedDigisEventEE = 0;
600  const PCaloHitContainer* phitsEE=nullptr;
601  phitsEE = eeSimHits.product();
602  for(SimTrackContainer::const_iterator simTrack = simTracks->begin(); simTrack != simTracks->end(); ++simTrack)
603  {
604  // Check if the particleId is in our list
605  std::vector<int>::const_iterator partIdItr = find(particleIds_.begin(),particleIds_.end(),simTrack->type());
606  if(partIdItr==particleIds_.end())
607  continue;
608 
609  PCaloHitContainer mySimHitsEE;
610  std::vector<EEDataFrame> myDigisEE;
611 
612  //int particleId = simTrack->type();
613  int trackId = simTrack->trackId();
614  PCaloHitContainer::const_iterator simHitItr = phitsEE->begin();
615  while(simHitItr != phitsEE->end())
616  {
617  if(simHitItr->geantTrackId()==trackId)
618  mySimHitsEE.push_back(*simHitItr);
619  ++simHitItr;
620  }
621  if(mySimHitsEE.empty())
622  {
623  std::cout << "Could not find matching EE PCaloHits for SimTrack id: " << trackId << ". Skipping this SimTrack" << std::endl;
624  continue;
625  }
626 
627  // Loop over matching PCaloHits
628  for(simHitItr = mySimHitsEE.begin(); simHitItr != mySimHitsEE.end(); ++simHitItr)
629  {
630  simHitsEcalEnergyHistEE_->Fill(simHitItr->energy());
631  simHitsEcalTimeHistEE_->Fill(simHitItr->time());
632  simHitsEcalEnergyVsTimeHistEE_->Fill(simHitItr->time(),simHitItr->energy());
633  EEDetId simHitId = EEDetId(simHitItr->id());
634  std::cout << "SimHit DetId found: " << simHitId << " for PDGid: " << simTrack->type() << std::endl;
635  //std::cout << "SimHit hashedIndex: " << simHitId.hashedIndex() << std::endl;
636  std::cout << "SimHit energy: " << simHitItr->energy() << " time: " << simHitItr->time() << std::endl;
637  ++numMatchedSimHitsEventEE;
638 
639  EEDigiCollection::const_iterator digiItr = eeDigis->begin();
640  while(digiItr != eeDigis->end() && (digiItr->id() != simHitId))
641  ++digiItr;
642  if(digiItr==eeDigis->end())
643  {
644  // Commented out for debugging ease, Aug 3 2009
645  std::cout << "Could not find simHit detId: " << simHitId << "in EEDigiCollection!" << std::endl;
646  continue;
647  }
648  std::vector<EEDataFrame>::const_iterator myDigiItr = myDigisEE.begin();
649  while(myDigiItr != myDigisEE.end() && (digiItr->id() != myDigiItr->id()))
650  ++myDigiItr;
651  if(myDigiItr!=myDigisEE.end())
652  continue; // if this digi is already in the list, skip it
653 
654  ++numMatchedDigisEventEE;
655  EEDataFrame df = *digiItr;
656  myDigisEE.push_back(df);
657  std::cout << "SAMPLE ADCs: " << "\t";
658  for(int i=0; i<10;++i)
659  std::cout << i << "\t";
660  std::cout << std::endl << "\t\t";
661  for(int i=0; i < df.size(); ++i)
662  {
663  std::cout << df.sample(i).adc() << "\t";
664  }
665  std::cout << std::endl << std::endl;
666 
667  simHitsEcalDigiMatchEnergyHistEE_->Fill(simHitItr->energy());
668  simHitsEcalDigiMatchTimeHistEE_->Fill(simHitItr->time());
669  simHitsEcalDigiMatchEnergyVsTimeHistEE_->Fill(simHitItr->time(),simHitItr->energy());
670  if(((EEDetId)digiItr->id()).zside() > 0)
671  digiOccupancyMapEEP_->Fill(((EEDetId)digiItr->id()).ix(),((EEDetId)digiItr->id()).iy());
672  else if(((EEDetId)digiItr->id()).zside() < 0)
673  digiOccupancyMapEEM_->Fill(((EEDetId)digiItr->id()).ix(),((EEDetId)digiItr->id()).iy());
674  }
675  }
676  simHitsEcalNumHistEE_->Fill(numMatchedSimHitsEventEE);
677  digisEcalNumHistEE_->Fill(numMatchedDigisEventEE);
678 
679 }
TH2F * simHitsEcalDigiMatchEnergyVsTimeHistEE_
edm::EDGetTokenT< EEDigiCollection > EEDigiCollectionToken_
std::vector< PCaloHit > PCaloHitContainer
TH1F * simHitsEcalTimeHistEE_
edm::EDGetTokenT< EBDigiCollection > EBDigiCollectionToken_
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
edm::EDGetTokenT< edm::PCaloHitContainer > eeSimHitToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
TH2F * simHitsEcalEnergyVsTimeHistEB_
TH1F * simHitsEcalEnergyHistEE_
edm::EDGetTokenT< edm::PCaloHitContainer > ebSimHitToken_
TH1F * digisEcalNumHistEE_
TH2F * digiOccupancyMapEEM_
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:29
const_iterator begin() const
int zside(DetId const &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
TH1F * simHitsEcalDigiMatchTimeHistEB_
std::vector< int > particleIds_
Definition: HSCPValidator.h:80
int size() const
Definition: EcalDataFrame.h:26
TH1F * simHitsEcalNumHistEE_
TH2F * digiOccupancyMapEEP_
TH2F * digiOccupancyMapEB_
TH2F * simHitsEcalDigiMatchEnergyVsTimeHistEB_
TH1F * simHitsEcalDigiMatchEnergyHistEE_
TH1F * simHitsEcalDigiMatchTimeHistEE_
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken_
TH2F * simHitsEcalEnergyVsTimeHistEE_
TH1F * simHitsEcalDigiMatchIEtaHist_
TH1F * simHitsEcalNumHistEB_
T const * product() const
Definition: Handle.h:74
TH1F * digisEcalNumHistEB_
TH1F * simHitsEcalDigiMatchIPhiHist_
TH1F * simHitsEcalDigiMatchEnergyHistEB_
const_iterator end() const
HLT enums.
TH1F * simHitsEcalEnergyHistEB_
int adc() const
get the ADC sample (12 bits)
TH1F * simHitsEcalTimeHistEB_
void HSCPValidator::makeSimDigiPlotsRPC ( const edm::Event iEvent)
private

Definition at line 737 of file HSCPValidator.cc.

References cluSizeDistribution_, gather_cfg::cout, efficiencyRPCRecHitSimDigis_, PV3DBase< T, PVType, FrameType >::eta(), HcalObjRepresent::Fill(), spr::find(), edm::Event::getByToken(), edm::Event::getManyByType(), mps_fire::i, createfilelist::int, RPCDetId::layer(), PV3DBase< T, PVType, FrameType >::mag(), DetId::Muon, RPCGeomServ::name(), particleIds_, PV3DBase< T, PVType, FrameType >::phi(), rpcPointValidation_cfi::recHit, RPCDetId::region(), residualsRPCRecHitSimDigis_, RPCGeometry::roll(), MuonSubdetId::RPC, rpcBXBarrel_, rpcBXEndCap_, rpcGeo, JetIDParams_cfi::rpcRecHits, rpcRecHitsToken_, rpcTimeOfFlightBarrel_, rpcTimeOfFlightEndCap_, RPCDetId::station(), GeomDet::surface(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by analyze().

738 {
739  using namespace edm;
740 
741  //std::cout << " Getting the SimHits " <<std::endl;
742  std::vector<Handle<edm::PSimHitContainer> > theSimHitContainers;
743  iEvent.getManyByType(theSimHitContainers);
744  //std::cout << " The Number of sim Hits is " << theSimHitContainers.size() <<std::endl;
745 
747  iEvent.getByToken(rpcRecHitsToken_,rpcRecHits);
748 
749  //SimTrack Stuff
750  std::vector<PSimHit> theSimHits;
751 
752  for (int i = 0; i < int(theSimHitContainers.size()); i++){
753  theSimHits.insert(theSimHits.end(),theSimHitContainers.at(i)->begin(),theSimHitContainers.at(i)->end());
754  }
755 
756 
757  for (std::vector<PSimHit>::const_iterator iHit = theSimHits.begin(); iHit != theSimHits.end(); iHit++){
758 
759  std::vector<int>::const_iterator partIdItr = find(particleIds_.begin(),particleIds_.end(),(*iHit).particleType());
760  if(partIdItr==particleIds_.end())
761  continue;
762 
763  DetId theDetUnitId((*iHit).detUnitId());
764 
765  DetId simdetid= DetId((*iHit).detUnitId());
766 
767  if(simdetid.det()==DetId::Muon && simdetid.subdetId()== MuonSubdetId::RPC){//Only RPCs
768 
769  RPCDetId rollId(theDetUnitId);
770  RPCGeomServ rpcsrv(rollId);
771 
772  //std::cout << " Reading the Roll"<<std::endl;
773  const RPCRoll* rollasociated = rpcGeo->roll(rollId);
774 
775  //std::cout << " Getting the Surface"<<std::endl;
776  const BoundPlane & RPCSurface = rollasociated->surface();
777 
778  GlobalPoint SimHitInGlobal = RPCSurface.toGlobal((*iHit).localPosition());
779 
780  std::cout<<"\t\t We have an RPC Sim Hit! in t="<<(*iHit).timeOfFlight()<<"ns "<<rpcsrv.name()<<" Global postition="<<SimHitInGlobal<<std::endl;
781 
782  int layer = 0;
783 
784  if(rollId.station()==1&&rollId.layer()==1) layer = 1;
785  else if(rollId.station()==1&&rollId.layer()==2) layer = 2;
786  else if(rollId.station()==2&&rollId.layer()==1) layer = 3;
787  else if(rollId.station()==2&&rollId.layer()==2) layer = 4;
788  else if(rollId.station()==3) layer = 5;
789  else if(rollId.station()==4) layer = 6;
790 
791  if(rollId.region()==0){
792  rpcTimeOfFlightBarrel_[layer-1]->Fill((*iHit).timeOfFlight());
793  }else{
794  rpcTimeOfFlightEndCap_[rollId.station()-1]->Fill((*iHit).timeOfFlight());
795  }
796 
797  std::cout<<"\t\t r="<<SimHitInGlobal.mag()<<" phi="<<SimHitInGlobal.phi()<<" eta="<<SimHitInGlobal.eta()<<std::endl;
798 
799  int cluSize = 0;
800  int bx = 100;
801  float minres = 3000.;
802 
803  std::cout<<"\t \t \t \t Getting RecHits in Roll Asociated"<<std::endl;
804 
805  typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
806  rangeRecHits recHitCollection = rpcRecHits->get(rollId);
808 
810 
811  for(recHit = recHitCollection.first; recHit != recHitCollection.second ; recHit++){
812  LocalPoint recHitPos=recHit->localPosition();
813  float res=(*iHit).localPosition().x()- recHitPos.x();
814  if(fabs(res)<fabs(minres)){
815  minres=res;
816  cluSize = recHit->clusterSize();
817  bx=recHit->BunchX();
818  std::cout<<"\t New Min Res "<<res<<"cm."<<std::endl;
819  }
820  }
821 
822  if(minres<3000.){
823  residualsRPCRecHitSimDigis_->Fill(minres);
825  cluSizeDistribution_->Fill(cluSize);
826  if(rollId.region()==0) rpcBXBarrel_[layer-1]->Fill(bx);
827  else rpcBXEndCap_[rollId.station()-1]->Fill(bx);
828  }
829  }
830  }
831 }
TH1F * rpcTimeOfFlightBarrel_[6]
TH1F * rpcTimeOfFlightEndCap_[3]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
void getManyByType(std::vector< Handle< PROD >> &results) const
Definition: Event.h:508
TH1F * cluSizeDistribution_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
std::vector< int > particleIds_
Definition: HSCPValidator.h:80
Definition: Electron.h:6
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
T mag() const
Definition: PV3DBase.h:67
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
TH1F * efficiencyRPCRecHitSimDigis_
edm::EDGetTokenT< RPCRecHitCollection > rpcRecHitsToken_
Definition: HSCPValidator.h:78
TH1F * rpcBXBarrel_[6]
TH1F * residualsRPCRecHitSimDigis_
Definition: DetId.h:18
TH1F * rpcBXEndCap_[3]
static constexpr int RPC
Definition: MuonSubdetId.h:14
T eta() const
Definition: PV3DBase.h:76
HLT enums.
edm::ESHandle< RPCGeometry > rpcGeo
T x() const
Definition: PV3DBase.h:62
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
Definition: RPCGeometry.cc:75
void HSCPValidator::makeSimTrackPlots ( const edm::Event iEvent)
private

Definition at line 350 of file HSCPValidator.cc.

References spr::find(), edm::Event::getByToken(), particleIds_, edm::Handle< T >::product(), muonSimHitMatcherPSet::simTrack, simTrackParticleBetaHist_, simTrackParticleEtaHist_, simTrackParticlePhiHist_, simTrackParticlePHist_, simTrackParticlePtHist_, tkConvValidator_cfi::simTracks, and simTracksToken_.

Referenced by analyze().

351 { using namespace edm;
352  //get sim track infos
353  Handle<edm::SimTrackContainer> simTracksHandle;
354  iEvent.getByToken(simTracksToken_,simTracksHandle);
355  const SimTrackContainer simTracks = *(simTracksHandle.product());
356 
357  SimTrackContainer::const_iterator simTrack;
358 
359  for (simTrack = simTracks.begin(); simTrack != simTracks.end(); ++simTrack){
360  // Check if the particleId is in our list
361  std::vector<int>::const_iterator partIdItr = find(particleIds_.begin(),particleIds_.end(),simTrack->type());
362  if(partIdItr==particleIds_.end()) continue;
363 
364  simTrackParticleEtaHist_->Fill((*simTrack).momentum().eta());
365  simTrackParticlePhiHist_->Fill((*simTrack).momentum().phi());
366  simTrackParticlePHist_->Fill((*simTrack).momentum().P());
367 
368  simTrackParticlePtHist_->Fill((*simTrack).momentum().pt());
369 
370  simTrackParticleBetaHist_->Fill((*simTrack).momentum().P()/(*simTrack).momentum().e());
371 
372  // std::cout<<"Particle:"<<simTrack->type()<<" Charge:"<<simTrack->charge()<<std::endl;
373 
374  }
375 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< int > particleIds_
Definition: HSCPValidator.h:80
TH1F * simTrackParticlePtHist_
edm::EDGetTokenT< edm::SimTrackContainer > simTracksToken_
Definition: HSCPValidator.h:74
T const * product() const
Definition: Handle.h:74
TH1F * simTrackParticleEtaHist_
Definition: HSCPValidator.h:98
HLT enums.
TH1F * simTrackParticlePhiHist_
Definition: HSCPValidator.h:99
TH1F * simTrackParticleBetaHist_
std::vector< SimTrack > SimTrackContainer
TH1F * simTrackParticlePHist_

Member Data Documentation

TH1F* HSCPValidator::cluSizeDistribution_
private

Definition at line 136 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsRPC().

edm::EDGetTokenT<edm::ValueMap<reco::DeDxData> > HSCPValidator::dEdxTrackToken_
private

Definition at line 77 of file HSCPValidator.h.

Referenced by makeRecoPlots().

TH2F* HSCPValidator::dedxVsp
private

Definition at line 147 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeRecoPlots().

TH2F* HSCPValidator::digiOccupancyMapEB_
private

Definition at line 130 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH2F* HSCPValidator::digiOccupancyMapEEM_
private

Definition at line 132 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH2F* HSCPValidator::digiOccupancyMapEEP_
private

Definition at line 131 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::digisEcalNumHistEB_
private

Definition at line 128 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::digisEcalNumHistEE_
private

Definition at line 129 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

bool HSCPValidator::doGenPlots_
private

Definition at line 66 of file HSCPValidator.h.

Referenced by analyze().

bool HSCPValidator::doHLTPlots_
private

Definition at line 67 of file HSCPValidator.h.

Referenced by analyze().

bool HSCPValidator::doRecoPlots_
private

Definition at line 70 of file HSCPValidator.h.

Referenced by analyze().

bool HSCPValidator::doSimDigiPlots_
private

Definition at line 69 of file HSCPValidator.h.

Referenced by analyze().

bool HSCPValidator::doSimTrackPlots_
private

Definition at line 68 of file HSCPValidator.h.

Referenced by analyze().

edm::EDGetTokenT<EBDigiCollection> HSCPValidator::EBDigiCollectionToken_
private

Definition at line 108 of file HSCPValidator.h.

Referenced by makeSimDigiPlotsECAL().

edm::EDGetTokenT<edm::PCaloHitContainer> HSCPValidator::ebSimHitToken_
private

Definition at line 105 of file HSCPValidator.h.

Referenced by makeSimDigiPlotsECAL().

edm::EDGetTokenT<EEDigiCollection> HSCPValidator::EEDigiCollectionToken_
private

Definition at line 109 of file HSCPValidator.h.

Referenced by makeSimDigiPlotsECAL().

edm::EDGetTokenT<edm::PCaloHitContainer> HSCPValidator::eeSimHitToken_
private

Definition at line 106 of file HSCPValidator.h.

Referenced by makeSimDigiPlotsECAL().

TH1F* HSCPValidator::efficiencyRPCRecHitSimDigis_
private

Definition at line 135 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsRPC().

TH1F* HSCPValidator::h_genhscp_met
private

Definition at line 91 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeGenPlots().

TH1F* HSCPValidator::h_genhscp_met_nohscp
private

Definition at line 92 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeGenPlots().

TH1F* HSCPValidator::h_genhscp_scaloret
private

Definition at line 93 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeGenPlots().

TH1F* HSCPValidator::h_genhscp_scaloret_nohscp
private

Definition at line 94 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeGenPlots().

TH1F* HSCPValidator::hltjet
private

Definition at line 143 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeHLTPlots().

TH1F* HSCPValidator::hltmet
private

Definition at line 142 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeHLTPlots().

TH1F* HSCPValidator::hltmu
private

Definition at line 144 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeHLTPlots().

TH1F* HSCPValidator::particleBetaHist_
private

Definition at line 89 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeGenPlots().

TH1F* HSCPValidator::particleBetaInverseHist_
private

Definition at line 90 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeGenPlots().

TH1F* HSCPValidator::particleEtaHist_
private

Definition at line 83 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeGenPlots().

std::vector<int> HSCPValidator::particleIds_
private
std::map<int,int> HSCPValidator::particleIdsFoundMap_
private

Definition at line 82 of file HSCPValidator.h.

Referenced by endJob(), and makeGenPlots().

TH1F* HSCPValidator::particleMassHist_
private

Definition at line 87 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeGenPlots().

TH1F* HSCPValidator::particlePhiHist_
private

Definition at line 84 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeGenPlots().

TH1F* HSCPValidator::particlePHist_
private

Definition at line 85 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeGenPlots().

TH1F* HSCPValidator::particlePtHist_
private

Definition at line 86 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeGenPlots().

int HSCPValidator::particleStatus_
private

Definition at line 81 of file HSCPValidator.h.

Referenced by makeGenPlots(), and makeRecoPlots().

TH1F* HSCPValidator::particleStatusHist_
private

Definition at line 88 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeGenPlots().

TH2F* HSCPValidator::RecoHSCPPtVsGenPt
private

Definition at line 146 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeRecoPlots().

TH1F* HSCPValidator::residualsRPCRecHitSimDigis_
private

Definition at line 134 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsRPC().

TH1F* HSCPValidator::rpcBXBarrel_[6]
private

Definition at line 138 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsRPC().

TH1F* HSCPValidator::rpcBXEndCap_[3]
private

Definition at line 140 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsRPC().

edm::ESHandle<RPCGeometry> HSCPValidator::rpcGeo
private

Definition at line 110 of file HSCPValidator.h.

Referenced by analyze(), and makeSimDigiPlotsRPC().

edm::EDGetTokenT<RPCRecHitCollection> HSCPValidator::rpcRecHitsToken_
private

Definition at line 78 of file HSCPValidator.h.

Referenced by makeSimDigiPlotsRPC().

TH1F* HSCPValidator::rpcTimeOfFlightBarrel_[6]
private

Definition at line 137 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsRPC().

TH1F* HSCPValidator::rpcTimeOfFlightEndCap_[3]
private

Definition at line 139 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsRPC().

TH1F* HSCPValidator::simHitsEcalDigiMatchEnergyHistEB_
private

Definition at line 120 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::simHitsEcalDigiMatchEnergyHistEE_
private

Definition at line 123 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH2F* HSCPValidator::simHitsEcalDigiMatchEnergyVsTimeHistEB_
private

Definition at line 122 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH2F* HSCPValidator::simHitsEcalDigiMatchEnergyVsTimeHistEE_
private

Definition at line 125 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::simHitsEcalDigiMatchIEtaHist_
private

Definition at line 126 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::simHitsEcalDigiMatchIPhiHist_
private

Definition at line 127 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::simHitsEcalDigiMatchTimeHistEB_
private

Definition at line 121 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::simHitsEcalDigiMatchTimeHistEE_
private

Definition at line 124 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::simHitsEcalEnergyHistEB_
private

Definition at line 112 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::simHitsEcalEnergyHistEE_
private

Definition at line 116 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH2F* HSCPValidator::simHitsEcalEnergyVsTimeHistEB_
private

Definition at line 115 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH2F* HSCPValidator::simHitsEcalEnergyVsTimeHistEE_
private

Definition at line 119 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::simHitsEcalNumHistEB_
private

Definition at line 114 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::simHitsEcalNumHistEE_
private

Definition at line 118 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::simHitsEcalTimeHistEB_
private

Definition at line 113 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::simHitsEcalTimeHistEE_
private

Definition at line 117 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimDigiPlotsECAL().

TH1F* HSCPValidator::simTrackParticleBetaHist_
private

Definition at line 102 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimTrackPlots().

TH1F* HSCPValidator::simTrackParticleEtaHist_
private

Definition at line 98 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimTrackPlots().

TH1F* HSCPValidator::simTrackParticlePhiHist_
private

Definition at line 99 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimTrackPlots().

TH1F* HSCPValidator::simTrackParticlePHist_
private

Definition at line 100 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimTrackPlots().

TH1F* HSCPValidator::simTrackParticlePtHist_
private

Definition at line 101 of file HSCPValidator.h.

Referenced by HSCPValidator(), and makeSimTrackPlots().

edm::EDGetTokenT<edm::SimTrackContainer> HSCPValidator::simTracksToken_
private

Definition at line 74 of file HSCPValidator.h.

Referenced by makeSimTrackPlots().

edm::EDGetTokenT<edm::SimTrackContainer> HSCPValidator::simTrackToken_
private

Definition at line 107 of file HSCPValidator.h.

Referenced by makeSimDigiPlotsECAL().

edm::EDGetTokenT<reco::TrackCollection> HSCPValidator::tkTracksToken_
private

Definition at line 76 of file HSCPValidator.h.

Referenced by makeRecoPlots().

edm::EDGetTokenT<edm::HepMCProduct> HSCPValidator::token_
private

Definition at line 73 of file HSCPValidator.h.

Referenced by makeGenPlots(), and makeRecoPlots().

edm::EDGetTokenT<trigger::TriggerEvent> HSCPValidator::trEvToken_
private

Definition at line 75 of file HSCPValidator.h.

Referenced by makeHLTPlots().

edm::EDGetTokenT<edm::TriggerResults> HSCPValidator::triggerResultsToken_
private

Definition at line 79 of file HSCPValidator.h.

Referenced by makeHLTPlots().