CMS 3D CMS Logo

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

#include <Calibration/IsolatedParticles/plugins/StudyHLT.cc>

Inheritance diagram for StudyHLT:
edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 StudyHLT (const edm::ParameterSet &)
 
 ~StudyHLT () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
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)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void beginJob () override
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void clear ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void fillEnergy (int, int, double, double, double, double, double)
 
void fillIsolation (int, double, double, double)
 
void fillTrack (int, double, double, double, double)
 
int trackPID (const reco::Track *, const edm::Handle< reco::GenParticleCollection > &)
 
std::string truncate_str (const std::string &)
 

Private Attributes

bool changed_
 
const bool doTree_
 
int etaBin_ [nEtaBin_+1]
 
bool firstEvent_
 
edm::Service< TFileServicefs_
 
TH1D * h_counter [8]
 
TH1D * h_ediff [2]
 
TH1D * h_ene1 [2]
 
TH1D * h_ene2 [2]
 
TH1D * h_energy [nPVBin_+8][nPBin_][nEtaBin_][6]
 
TH1D * h_eta [nGen_+2]
 
TH1I * h_goodPV
 
TH1I * h_goodRun
 
TH1D * h_h_pNew [8]
 
TH1I * h_HLTAccept
 
std::vector< TH1I * > h_HLTAccepts
 
TH1I * h_HLTCorr
 
TH1D * h_maxNearP [2]
 
TH1I * h_nHLT
 
TH2I * h_nHLTvsRN
 
TH1I * h_ntrk [2]
 
TH1I * h_numberPV
 
TH1D * h_p [nGen_+2]
 
TH1D * h_phi [nGen_+2]
 
TH1D * h_pt [nGen_+2]
 
HLTConfigProvider hltConfig_
 
std::vector< std::string > HLTNames_
 
const bool isItAOD_
 
const double maxTrackEta_
 
const double minTrackP_
 
const std::vector< std::string > newNames_
 
int nRun_
 
double pBin_ [nPBin_+1]
 
const std::vector< double > puWeights_
 
int pvBin_ [nPVBin_+1]
 
spr::trackSelectionParameters selectionParameters_
 
const std::string theTrackQuality_
 
const edm::InputTag theTriggerResultsLabel_
 
const double tMaxE_
 
const double tMaxH_
 
const double tMinE_
 
const double tMinH_
 
edm::EDGetTokenT< EcalRecHitCollectiontok_EB_
 
edm::EDGetTokenT< EcalRecHitCollectiontok_EE_
 
edm::EDGetTokenT< GenEventInfoProducttok_ew_
 
edm::EDGetTokenT< reco::TrackCollectiontok_genTrack_
 
edm::EDGetTokenT< HBHERecHitCollectiontok_hbhe_
 
edm::EDGetTokenT< LumiDetailstok_lumi
 
edm::EDGetTokenT< reco::GenParticleCollectiontok_parts_
 
edm::EDGetTokenT< reco::VertexCollectiontok_recVtx_
 
edm::EDGetTokenT< trigger::TriggerEventtok_trigEvt
 
edm::EDGetTokenT< edm::TriggerResultstok_trigRes
 
double tr_eventWeight
 
std::vector< double > tr_FE11x11P
 
std::vector< double > tr_FE15x15P
 
std::vector< double > tr_FE7x7P
 
int tr_goodPV
 
int tr_goodRun
 
std::vector< double > tr_H3x3
 
std::vector< double > tr_H5x5
 
std::vector< double > tr_H7x7
 
std::vector< int > tr_iEta
 
std::vector< double > tr_MaxNearHcalP7x7
 
std::vector< double > tr_MaxNearP31X31
 
std::vector< bool > tr_SE11x11P
 
std::vector< bool > tr_SE15x15P
 
std::vector< bool > tr_SE7x7P
 
std::vector< std::string > tr_TrigName
 
std::vector< double > tr_TrkEta
 
std::vector< int > tr_TrkID
 
std::vector< double > tr_TrkP
 
std::vector< double > tr_TrkPhi
 
std::vector< double > tr_TrkPt
 
TTree * tree_
 
const edm::InputTag triggerEvent_
 
const std::vector< std::string > trigNames_
 
const int verbosity_
 
const bool vetoTrigger_
 

Static Private Attributes

static const int nEtaBin_ =4
 
static const int nGen_ =(nPVBin_+12)
 
static const int nPBin_ =15
 
static const int nPVBin_ =4
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 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: Studies single particle response measurements in data/MC

Implementation: <Notes on="" implementation>="">

Definition at line 82 of file StudyHLT.cc.

Constructor & Destructor Documentation

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

Definition at line 157 of file StudyHLT.cc.

References changed_, doTree_, etaBin_, firstEvent_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), mps_fire::i, isItAOD_, gen::k, TFileService::kSharedResource, spr::trackSelectionParameters::maxChi2, spr::trackSelectionParameters::maxDpOverP, spr::trackSelectionParameters::maxDxyPV, spr::trackSelectionParameters::maxDzPV, spr::trackSelectionParameters::maxInMiss, spr::trackSelectionParameters::maxOutMiss, maxTrackEta_, spr::trackSelectionParameters::minLayerCrossed, spr::trackSelectionParameters::minOuterHit, spr::trackSelectionParameters::minPt, spr::trackSelectionParameters::minQuality, minTrackP_, nEtaBin_, nPBin_, nPVBin_, pBin_, pvBin_, reco::TrackBase::qualityByName(), selectionParameters_, theTrackQuality_, theTriggerResultsLabel_, tMaxE_, tMaxH_, tMinE_, tMinH_, tok_EB_, tok_EE_, tok_ew_, tok_genTrack_, tok_hbhe_, tok_lumi, tok_parts_, tok_recVtx_, tok_trigEvt, tok_trigRes, photonIsolationHIProducer_cfi::trackQuality, triggerEvent_, trigNames_, verbosity_, and vetoTrigger_.

157  :
158  verbosity_(iConfig.getUntrackedParameter<int>("verbosity",0)),
159  trigNames_(iConfig.getUntrackedParameter<std::vector<std::string> >("triggers")),
160  newNames_(iConfig.getUntrackedParameter<std::vector<std::string> >("newNames")),
161  theTrackQuality_(iConfig.getUntrackedParameter<std::string>("trackQuality","highPurity")),
162  minTrackP_(iConfig.getUntrackedParameter<double>("minTrackP",1.0)),
163  maxTrackEta_(iConfig.getUntrackedParameter<double>("maxTrackEta",2.5)),
164  tMinE_(iConfig.getUntrackedParameter<double>("timeMinCutECAL",-500.)),
165  tMaxE_(iConfig.getUntrackedParameter<double>("timeMaxCutECAL",500.)),
166  tMinH_(iConfig.getUntrackedParameter<double>("timeMinCutHCAL",-500.)),
167  tMaxH_(iConfig.getUntrackedParameter<double>("timeMaxCutHCAL",500.)),
168  isItAOD_(iConfig.getUntrackedParameter<bool>("isItAOD",false)),
169  vetoTrigger_(iConfig.getUntrackedParameter<bool>("vetoTrigger",false)),
170  doTree_(iConfig.getUntrackedParameter<bool>("doTree",false)),
171  puWeights_(iConfig.getUntrackedParameter<std::vector<double> >("puWeights")),
172  triggerEvent_(edm::InputTag("hltTriggerSummaryAOD","","HLT")),
173  theTriggerResultsLabel_(edm::InputTag("TriggerResults","","HLT")), nRun_(0) {
174 
175  usesResource(TFileService::kSharedResource);
176 
178  selectionParameters_.minPt = iConfig.getUntrackedParameter<double>("minTrackPt", 10.0);
180  selectionParameters_.maxDxyPV = iConfig.getUntrackedParameter<double>("maxDxyPV", 0.2);
181  selectionParameters_.maxDzPV = iConfig.getUntrackedParameter<double>("maxDzPV", 5.0);
182  selectionParameters_.maxChi2 = iConfig.getUntrackedParameter<double>("maxChi2", 5.0);
183  selectionParameters_.maxDpOverP = iConfig.getUntrackedParameter<double>("maxDpOverP", 0.1);
184  selectionParameters_.minOuterHit = iConfig.getUntrackedParameter<int>("minOuterHit", 4);
185  selectionParameters_.minLayerCrossed= iConfig.getUntrackedParameter<int>("minLayerCrossed", 8);
186  selectionParameters_.maxInMiss = iConfig.getUntrackedParameter<int>("maxInMiss", 0);
187  selectionParameters_.maxOutMiss = iConfig.getUntrackedParameter<int>("maxOutMiss", 0);
188 
189  // define tokens for access
190  tok_lumi = consumes<LumiDetails, edm::InLumi>(edm::InputTag("lumiProducer"));
191  tok_trigEvt = consumes<trigger::TriggerEvent>(triggerEvent_);
192  tok_trigRes = consumes<edm::TriggerResults>(theTriggerResultsLabel_);
193  tok_genTrack_ = consumes<reco::TrackCollection>(edm::InputTag("generalTracks"));
194  tok_recVtx_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
195  tok_parts_ = consumes<reco::GenParticleCollection>(iConfig.getParameter<edm::InputTag>("particleSource"));
196 
197  if (isItAOD_) {
198  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEB"));
199  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEE"));
200  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("reducedHcalRecHits", "hbhereco"));
201  } else {
202  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEB"));
203  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEE"));
204  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("hbhereco"));
205  }
206  tok_ew_ = consumes<GenEventInfoProduct>(edm::InputTag("generator"));
207 
208  edm::LogInfo("IsoTrack") << "Verbosity " << verbosity_ << " with "
209  << trigNames_.size() << " triggers:";
210  for (unsigned int k=0; k<trigNames_.size(); ++k)
211  edm::LogInfo("IsoTrack") << " [" << k << "] " << trigNames_[k];
212  edm::LogInfo("IsoTrack") << "TrackQuality " << theTrackQuality_ << " Minpt "
213  << selectionParameters_.minPt << " maxDxy "
214  << selectionParameters_.maxDxyPV << " maxDz "
215  << selectionParameters_.maxDzPV << " maxChi2 "
216  << selectionParameters_.maxChi2 << " maxDp/p "
217  << selectionParameters_.maxDpOverP << " minOuterHit "
218  << selectionParameters_.minOuterHit << " minLayerCrossed "
219  << selectionParameters_.minLayerCrossed << " maxInMiss "
220  << selectionParameters_.maxInMiss << " maxOutMiss "
221  << selectionParameters_.maxOutMiss << " minTrackP "
222  << minTrackP_ << " maxTrackEta " << maxTrackEta_
223  << " tMinE_ " << tMinE_ << " tMaxE " << tMaxE_
224  << " tMinH_ " << tMinH_ << " tMaxH_ " << tMaxH_
225  << " isItAOD " << isItAOD_ << " doTree " << doTree_
226  << " vetoTrigger " << vetoTrigger_;
227 
228  double pBins[nPBin_+1] = {1.0,2.0,3.0,4.0,5.0,6.0,7.0,9.0,11.0,15.0,20.0,
229  25.0,30.0,40.0,60.0,100.0};
230  int etaBins[nEtaBin_+1] = {1, 7, 13, 17, 23};
231  int pvBins[nPVBin_+1] = {1, 2, 3, 5, 100};
232  for (int i=0; i<=nPBin_; ++i) pBin_[i] = pBins[i];
233  for (int i=0; i<=nEtaBin_; ++i) etaBin_[i] = etaBins[i];
234  for (int i=0; i<=nPVBin_; ++i) pvBin_[i] = pvBins[i];
235 
236  firstEvent_ = true;
237  changed_ = false;
238 }
const edm::InputTag theTriggerResultsLabel_
Definition: StudyHLT.cc:118
static const std::string kSharedResource
Definition: TFileService.h:76
const double tMinH_
Definition: StudyHLT.cc:115
T getParameter(std::string const &) const
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
Definition: StudyHLT.cc:130
T getUntrackedParameter(std::string const &, T const &) const
const std::string theTrackQuality_
Definition: StudyHLT.cc:113
bool firstEvent_
Definition: StudyHLT.cc:121
const edm::InputTag triggerEvent_
Definition: StudyHLT.cc:118
const double tMinE_
Definition: StudyHLT.cc:115
TrackQuality
track quality
Definition: TrackBase.h:151
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
Definition: StudyHLT.cc:132
edm::EDGetTokenT< reco::GenParticleCollection > tok_parts_
Definition: StudyHLT.cc:126
static const int nPBin_
Definition: StudyHLT.cc:107
const double tMaxH_
Definition: StudyHLT.cc:115
static const int nPVBin_
Definition: StudyHLT.cc:107
const int verbosity_
Definition: StudyHLT.cc:111
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
Definition: StudyHLT.cc:127
bool changed_
Definition: StudyHLT.cc:121
const double tMaxE_
Definition: StudyHLT.cc:115
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
Definition: StudyHLT.cc:131
int etaBin_[nEtaBin_+1]
Definition: StudyHLT.cc:144
spr::trackSelectionParameters selectionParameters_
Definition: StudyHLT.cc:119
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
Definition: StudyHLT.cc:128
const std::vector< double > puWeights_
Definition: StudyHLT.cc:117
static const int nEtaBin_
Definition: StudyHLT.cc:107
int pvBin_[nPVBin_+1]
Definition: StudyHLT.cc:144
int k[5][pyjets_maxn]
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
Definition: StudyHLT.cc:129
const double maxTrackEta_
Definition: StudyHLT.cc:114
edm::EDGetTokenT< LumiDetails > tok_lumi
Definition: StudyHLT.cc:123
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
Definition: StudyHLT.cc:125
double pBin_[nPBin_+1]
Definition: StudyHLT.cc:145
reco::TrackBase::TrackQuality minQuality
const bool vetoTrigger_
Definition: StudyHLT.cc:116
const bool doTree_
Definition: StudyHLT.cc:116
const double minTrackP_
Definition: StudyHLT.cc:114
const bool isItAOD_
Definition: StudyHLT.cc:116
const std::vector< std::string > trigNames_
Definition: StudyHLT.cc:112
int nRun_
Definition: StudyHLT.cc:144
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
Definition: StudyHLT.cc:124
const std::vector< std::string > newNames_
Definition: StudyHLT.cc:112
StudyHLT::~StudyHLT ( )
inlineoverride

Definition at line 86 of file StudyHLT.cc.

References analyze(), beginJob(), beginRun(), endRun(), and fillDescriptions().

86 { }

Member Function Documentation

void StudyHLT::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 274 of file StudyHLT.cc.

References funct::abs(), edm::HLTGlobalStatus::accept(), ecalTB2006H4_GenSimDigiReco_cfg::bField, edm::EventBase::bunchCrossing(), spr::chargeIsolationEcal(), spr::chargeIsolationHcal(), clear(), particleFlow_cfi::dEta, doTree_, particleFlow_cfi::dPhi, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, spr::eECALmatrix(), spr::eHCALmatrix(), edm::EventID::event(), fillEnergy(), fillIsolation(), fillTrack(), firstEvent_, particlelevel_cff::genEventInfo, GenHFHadronMatcher_cfi::genParticles, edm::EventSetup::get(), edm::Event::getByToken(), h_counter, h_goodPV, h_goodRun, h_h_pNew, h_HLTAccept, h_HLTAccepts, h_HLTCorr, h_nHLT, h_nHLTvsRN, h_ntrk, h_numberPV, photonIsolationHIProducer_cfi::hbhe, ValidationMatrix::hlt, HLTNames_, mps_fire::i, edm::EventBase::id(), createfilelist::int, edm::HandleBase::isValid(), edm::InputTag::label(), mix_E10TeV_L13E31_BX432_cfi::Lumi, edm::EventBase::luminosityBlock(), M_PI, match(), maxTrackEta_, spr::trackSelectionParameters::minQuality, minTrackP_, reco::TrackBase::momentum(), newNames_, nGen_, nPVBin_, nRun_, convertSQLiteXML::ok, AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::p(), p1, edm::Handle< T >::product(), edm::ESHandle< T >::product(), spr::propagateCALO(), reco::TrackBase::pt(), hiDetachedQuadStep_cff::pt1, puWeights_, pvBin_, jets_cff::quality, reco::TrackBase::quality(), edm::EventID::run(), selectionParameters_, edm::HLTGlobalStatus::size(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, theTrackQuality_, tMaxE_, tMaxH_, tMinE_, tMinH_, tok_EB_, tok_EE_, tok_ew_, tok_genTrack_, tok_hbhe_, tok_parts_, tok_recVtx_, tok_trigEvt, tok_trigRes, tr_eventWeight, tr_FE11x11P, tr_FE15x15P, tr_FE7x7P, tr_goodPV, tr_goodRun, tr_H3x3, tr_H5x5, tr_H7x7, tr_iEta, tr_MaxNearHcalP7x7, tr_MaxNearP31X31, tr_SE11x11P, tr_SE15x15P, tr_SE7x7P, tr_TrigName, tr_TrkEta, tr_TrkID, tr_TrkP, tr_TrkPhi, tr_TrkPt, trackPID(), tree_, triggerEvent_, edm::TriggerNames::triggerNames(), edm::Event::triggerNames(), triggerResults, trigNames_, truncate_str(), verbosity_, vetoTrigger_, and GenEventInfoProduct::weight().

Referenced by ~StudyHLT().

274  {
275  clear();
276  int counter0[1000] = {0};
277  int counter1[1000] = {0};
278  int counter2[1000] = {0};
279  int counter3[1000] = {0};
280  int counter4[1000] = {0};
281  int counter5[1000] = {0};
282  int counter6[1000] = {0};
283  int counter7[1000] = {0};
284  if (verbosity_ > 0)
285  edm::LogInfo("IsoTrack") << "Event starts====================================";
286  int RunNo = iEvent.id().run();
287  int EvtNo = iEvent.id().event();
288  int Lumi = iEvent.luminosityBlock();
289  int Bunch = iEvent.bunchCrossing();
290 
291  std::vector<int> newAccept(newNames_.size()+1,0);
292  float mybxlumi=-1;
293  /*
294  edm::Handle<LumiDetails> Lumid;
295  iEvent.getLuminosityBlock().getByToken(tok_lumi,Lumid);
296  if (Lumid.isValid()) mybxlumi=Lumid->lumiValue(LumiDetails::kOCC1,iEvent.bunchCrossing())*6.37;
297  */
298  if (verbosity_ > 0)
299  edm::LogInfo("IsoTrack") << "RunNo " << RunNo << " EvtNo " << EvtNo
300  << " Lumi " << Lumi << " Bunch " << Bunch
301  << " mybxlumi " << mybxlumi;
302 
303  trigger::TriggerEvent triggerEvent;
304  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
305  iEvent.getByToken(tok_trigEvt,triggerEventHandle);
306 
307  bool ok(false);
308  if (!triggerEventHandle.isValid()) {
309  edm::LogWarning("IsoTrack") << "Error! Can't get the product "
310  << triggerEvent_.label();
311  } else {
312  triggerEvent = *(triggerEventHandle.product());
313 
316  iEvent.getByToken(tok_trigRes, triggerResults);
317 
318  if (triggerResults.isValid()) {
319  h_nHLT->Fill(triggerResults->size());
320  h_nHLTvsRN->Fill(RunNo, triggerResults->size());
321 
322  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
323  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
324  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
325  int ipos=-1;
326  std::string newtriggerName = truncate_str(triggerNames_[iHLT]);
327  for (unsigned int i=0; i<HLTNames_.size(); ++i) {
328  if (newtriggerName == HLTNames_[i]) {
329  ipos = i+1;
330  break;
331  }
332  }
333  if (ipos < 0) {
334  HLTNames_.push_back(newtriggerName);
335  ipos = (int)(HLTNames_.size());
336  if (ipos <= h_HLTAccept->GetNbinsX())
337  h_HLTAccept->GetXaxis()->SetBinLabel(ipos,newtriggerName.c_str());
338  }
339  if ((int)(iHLT+1) > h_HLTAccepts[nRun_]->GetNbinsX()) {
340  edm::LogInfo("IsoTrack") << "Wrong trigger " << RunNo << " Event "
341  << EvtNo << " Hlt " << iHLT;
342  } else {
343  if (firstEvent_) h_HLTAccepts[nRun_]->GetXaxis()->SetBinLabel(iHLT+1, newtriggerName.c_str());
344  }
345  int hlt = triggerResults->accept(iHLT);
346  if (hlt) {
347  h_HLTAccepts[nRun_]->Fill(iHLT+1);
348  h_HLTAccept->Fill(ipos);
349  }
350  if (trigNames_.empty()) {
351  ok = true;
352  } else {
353  for (unsigned int i=0; i<trigNames_.size(); ++i) {
354  if (newtriggerName.find(trigNames_[i]) != std::string::npos) {
355  if (verbosity_%10 > 0)
356  edm::LogInfo("IsoTrack") << newtriggerName;
357  if (hlt > 0) {
358  ok = true;
359  tr_TrigName.push_back(newtriggerName);
360  }
361  }
362  }
363  if (vetoTrigger_) ok = !ok;
364  for (unsigned int i=0; i<newNames_.size(); ++i) {
365  if (newtriggerName.find(newNames_[i]) != std::string::npos) {
366  if (verbosity_%10 > 0)
367  edm::LogInfo("IsoTrack") << "[" << i << "] " << newNames_[i]
368  << " : " << newtriggerName;
369  if (hlt > 0) newAccept[i] = 1;
370  }
371  }
372  }
373  }
374  int iflg(0), indx(1);
375  for (unsigned int i=0; i<newNames_.size(); ++i) {
376  iflg += (indx*newAccept[i]); indx *= 2;
377  }
378  h_HLTCorr->Fill(iflg);
379  }
380  }
381 
382  //Look at the tracks
383  if (ok) {
384  h_goodRun->Fill(RunNo);
385  tr_goodRun = RunNo;
386  // get handles to calogeometry and calotopology
388  iSetup.get<CaloGeometryRecord>().get(pG);
389  const CaloGeometry* geo = pG.product();
390 
391  edm::ESHandle<CaloTopology> theCaloTopology;
392  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
393  const CaloTopology *caloTopology = theCaloTopology.product();
394 
396  iSetup.get<HcalRecNumberingRecord>().get(htopo);
397  const HcalTopology* theHBHETopology = htopo.product();
398 
400  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
401  const MagneticField *bField = bFieldH.product();
402 
404  iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus);
405  const EcalChannelStatus* theEcalChStatus = ecalChStatus.product();
406 
408  iEvent.getByToken(tok_recVtx_,recVtxs);
409  int ntrk(0), ngoodPV(0), nPV(-1);
410  int nvtxs = (int)(recVtxs->size());
411  for (int ind=0; ind<nvtxs; ind++) {
412  if (!((*recVtxs)[ind].isFake()) && (*recVtxs)[ind].ndof() > 4) ngoodPV++;
413  }
414  for (int i=0; i<nPVBin_; ++i) {
415  if (ngoodPV >= pvBin_[i] && ngoodPV < pvBin_[i+1]) {
416  nPV = i; break;
417  }
418  }
419 
420  tr_eventWeight = 1.0;
422  iEvent.getByToken(tok_ew_, genEventInfo);
423  if (genEventInfo.isValid()) tr_eventWeight = genEventInfo->weight();
424 
425  if ((verbosity_/10)%10 > 0)
426  edm::LogInfo("IsoTrack") << "Number of vertices: " << nvtxs
427  << " Good " << ngoodPV << " Bin " << nPV
428  << " Event weight " << tr_eventWeight;
429  h_numberPV->Fill(nvtxs,tr_eventWeight);
430  h_goodPV->Fill(ngoodPV,tr_eventWeight);
431  tr_goodPV = ngoodPV;
432 
433  if (!puWeights_.empty()) {
434  int npbin = h_goodPV->FindBin(ngoodPV);
435  if (npbin > 0 && npbin <= (int)(puWeights_.size()))
436  tr_eventWeight *= puWeights_[npbin-1];
437  else
438  tr_eventWeight = 0;
439  }
440 
442  iEvent.getByToken(tok_genTrack_, trkCollection);
443 
444  //=== genParticle information
446  iEvent.getByToken(tok_parts_, genParticles);
447  if (genParticles.isValid()) {
448  for (const auto & p : (reco::GenParticleCollection)(*genParticles)) {
449  double pt1 = p.momentum().Rho();
450  double p1 = p.momentum().R();
451  double eta1 = p.momentum().Eta();
452  double phi1 = p.momentum().Phi();
453  fillTrack(nGen_, pt1,p1,eta1,phi1);
454  bool match(false);
455  double phi2(phi1);
456  if (phi2 < 0) phi2 += 2.0*M_PI;
457  for (const auto& trk : (reco::TrackCollection)(*trkCollection)) {
458  bool quality = trk.quality(selectionParameters_.minQuality);
459  if (quality) {
460  double dEta = trk.eta() - eta1;
461  double phi0 = trk.phi();
462  if (phi0 < 0) phi0 += 2.0*M_PI;
463  double dPhi = phi0-phi2;
464  if (dPhi > M_PI) dPhi -= 2.*M_PI;
465  else if (dPhi < -M_PI) dPhi += 2.*M_PI;
466  double dR = sqrt(dEta*dEta+dPhi*dPhi);
467  if (dR < 0.01) { match = true; break;}
468  }
469  }
470  if (match) fillTrack(nGen_+1, pt1,p1,eta1,phi1);
471  }
472  }
473 
474  reco::TrackCollection::const_iterator trkItr;
475  for (trkItr=trkCollection->begin(); trkItr != trkCollection->end(); ++trkItr,++ntrk) {
476  const reco::Track* pTrack = &(*trkItr);
477  double pt1 = pTrack->pt();
478  double p1 = pTrack->p();
479  double eta1 = pTrack->momentum().eta();
480  double phi1 = pTrack->momentum().phi();
481  bool quality = pTrack->quality(selectionParameters_.minQuality);
482  fillTrack(0, pt1,p1,eta1,phi1);
483  if (quality) fillTrack(1, pt1,p1,eta1,phi1);
484  if (p1<1000) {
485  h_h_pNew[0]->Fill(p1);
486  ++counter0[(int)(p1)];
487  }
488  }
489  h_ntrk[0]->Fill(ntrk,tr_eventWeight);
490 
491  std::vector<spr::propagatedTrackID> trkCaloDets;
492  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality_, trkCaloDets, ((verbosity_/100)%10 > 0));
493  std::vector<spr::propagatedTrackID>::const_iterator trkDetItr;
494  for (trkDetItr = trkCaloDets.begin(),ntrk=0; trkDetItr != trkCaloDets.end(); trkDetItr++,ntrk++) {
495  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
496  double pt1 = pTrack->pt();
497  double p1 = pTrack->p();
498  double eta1 = pTrack->momentum().eta();
499  double phi1 = pTrack->momentum().phi();
500  if ((verbosity_/10)%10 > 0)
501  edm::LogInfo("IsoTrack") << "track: p " << p1 << " pt " << pt1
502  << " eta " << eta1 << " phi " << phi1
503  << " okEcal " << trkDetItr->okECAL;
504  fillTrack(2, pt1,p1,eta1,phi1);
505  if (pt1>minTrackP_ && std::abs(eta1)<maxTrackEta_ && trkDetItr->okECAL) {
506  fillTrack(3, pt1,p1,eta1,phi1);
507  double maxNearP31x31 = spr::chargeIsolationEcal(ntrk, trkCaloDets, geo, caloTopology, 15, 15, ((verbosity_/1000)%10 > 0));
508 
510  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
511 
512  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
513  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
514  iEvent.getByToken(tok_EB_,barrelRecHitsHandle);
515  iEvent.getByToken(tok_EE_,endcapRecHitsHandle);
516  // get ECal Tranverse Profile
517  std::pair<double, bool> e7x7P, e11x11P, e15x15P;
518  const DetId isoCell = trkDetItr->detIdECAL;
519  e7x7P = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),3,3, 0.030, 0.150, tMinE_,tMaxE_, ((verbosity_/10000)%10 > 0));
520  e11x11P = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),5,5, 0.030, 0.150, tMinE_,tMaxE_, ((verbosity_/10000)%10 > 0));
521  e15x15P = spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),7,7, 0.030, 0.150, tMinE_,tMaxE_, ((verbosity_/10000)%10 > 0));
522 
523  double maxNearHcalP7x7 = spr::chargeIsolationHcal(ntrk, trkCaloDets, theHBHETopology, 3,3, ((verbosity_/1000)%10 > 0));
524  int ieta(0);
525  double h3x3(0), h5x5(0), h7x7(0);
526  fillIsolation(0, maxNearP31x31,e11x11P.first,e15x15P.first);
527  if ((verbosity_/10)%10 > 0)
528  edm::LogInfo("IsoTrack") << "Accepted Tracks reaching Ecal maxNearP31x31 "
529  << maxNearP31x31 << " e11x11P "
530  << e11x11P.first << " e15x15P "
531  << e15x15P.first << " okHCAL "
532  << trkDetItr->okHCAL;
533 
534  int trackID = trackPID(pTrack,genParticles);
535  if (trkDetItr->okHCAL) {
537  iEvent.getByToken(tok_hbhe_, hbhe);
538  const DetId ClosestCell(trkDetItr->detIdHCAL);
539  ieta = ((HcalDetId)(ClosestCell)).ietaAbs();
540  h3x3 = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,1,1, false, true, 0.7, 0.8, -100.0, -100.0, tMinH_,tMaxH_, ((verbosity_/10000)%10 > 0));
541  h5x5 = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,2,2, false, true, 0.7, 0.8, -100.0, -100.0, tMinH_,tMaxH_, ((verbosity_/10000)%10 > 0) );
542  h7x7 = spr::eHCALmatrix(theHBHETopology, ClosestCell, hbhe,3,3, false, true, 0.7, 0.8, -100.0, -100.0, tMinH_,tMaxH_, ((verbosity_/10000)%10 > 0) );
543  fillIsolation(1, maxNearHcalP7x7,h5x5,h7x7);
544  if ((verbosity_/10)%10 > 0)
545  edm::LogInfo("IsoTrack") << "Tracks Reaching Hcal maxNearHcalP7x7/h5x5/h7x7 "
546  << maxNearHcalP7x7 << "/" << h5x5 << "/" << h7x7;
547  tr_TrkPt.push_back(pt1);
548  tr_TrkP.push_back(p1);
549  tr_TrkEta.push_back(eta1);
550  tr_TrkPhi.push_back(phi1);
551  tr_TrkID.push_back(trackID);
552  tr_MaxNearP31X31.push_back(maxNearP31x31);
553  tr_MaxNearHcalP7x7.push_back(maxNearHcalP7x7);
554  tr_FE7x7P.push_back(e7x7P.first);
555  tr_FE11x11P.push_back(e11x11P.first);
556  tr_FE15x15P.push_back(e15x15P.first);
557  tr_SE7x7P.push_back(e7x7P.second);
558  tr_SE11x11P.push_back(e11x11P.second);
559  tr_SE15x15P.push_back(e15x15P.second);
560  tr_iEta.push_back(ieta);
561  tr_H3x3.push_back(h3x3);
562  tr_H5x5.push_back(h5x5);
563  tr_H7x7.push_back(h7x7);
564 
565  if (maxNearP31x31 < 0) {
566  fillTrack(4, pt1,p1,eta1,phi1);
567  fillEnergy(0,ieta,p1,e7x7P.first,h3x3,e11x11P.first,h5x5);
568  if (maxNearHcalP7x7 < 0) {
569  fillTrack(5, pt1,p1,eta1,phi1);
570  fillEnergy(1,ieta,p1,e7x7P.first,h3x3,e11x11P.first,h5x5);
571  if ((e11x11P.second) && (e15x15P.second) &&
572  (e15x15P.first-e11x11P.first)<2.0) {
573  fillTrack(6, pt1,p1,eta1,phi1);
574  fillEnergy(2,ieta,p1,e7x7P.first,h3x3,e11x11P.first,h5x5);
575  if (h7x7-h5x5 < 2.0) {
576  fillTrack(7, pt1,p1,eta1,phi1);
577  fillEnergy(3,ieta,p1,e7x7P.first,h3x3,e11x11P.first,h5x5);
578  if (nPV >= 0) {
579  fillTrack(nPV+8, pt1,p1,eta1,phi1);
580  fillEnergy(nPV+4,ieta,p1,e7x7P.first,h3x3,e11x11P.first,h5x5);
581  }
582  if (trackID > 0) {
583  fillTrack(nPVBin_+trackID+7, pt1,p1,eta1,phi1);
584  fillEnergy(nPVBin_+trackID+3,ieta,p1,e7x7P.first,h3x3,e11x11P.first,h5x5);
585  }
586  if (p1<1000) {
587  h_h_pNew[7]->Fill(p1);
588  ++counter7[(int)(p1)];
589  }
590  }
591  if (p1<1000) {
592  h_h_pNew[6]->Fill(p1);
593  ++counter6[(int)(p1)];
594  }
595  }
596  if (p1<1000) {
597  h_h_pNew[5]->Fill(p1);
598  ++counter5[(int)(p1)];
599  }
600  }
601  if (p1<1000) {
602  h_h_pNew[4]->Fill(p1);
603  ++counter4[(int)(p1)];
604  }
605  }
606  if (p1<1000) {
607  h_h_pNew[3]->Fill(p1);
608  ++counter3[(int)(p1)];
609  }
610  }
611  if (p1<1000) {
612  h_h_pNew[2]->Fill(p1);
613  ++counter2[(int)(p1)];
614  }
615  }
616  if (p1<1000) {
617  h_h_pNew[1]->Fill(p1);
618  ++counter1[(int)(p1)];
619  }
620  }
621  h_ntrk[1]->Fill(ntrk,tr_eventWeight);
622  if ((!tr_TrkPt.empty()) && doTree_) tree_->Fill();
623  for (int i=0; i <1000; ++i) {
624  if (counter0[i]) h_counter[0]->Fill(i, counter0[i]);
625  if (counter1[i]) h_counter[1]->Fill(i, counter1[i]);
626  if (counter2[i]) h_counter[2]->Fill(i, counter2[i]);
627  if (counter3[i]) h_counter[3]->Fill(i, counter3[i]);
628  if (counter4[i]) h_counter[4]->Fill(i, counter4[i]);
629  if (counter5[i]) h_counter[5]->Fill(i, counter5[i]);
630  if (counter6[i]) h_counter[6]->Fill(i, counter6[i]);
631  if (counter7[i]) h_counter[7]->Fill(i, counter7[i]);
632  }
633  }
634  firstEvent_ = false;
635 }
void fillEnergy(int, int, double, double, double, double, double)
Definition: StudyHLT.cc:853
const double tMinH_
Definition: StudyHLT.cc:115
double p() const
momentum vector magnitude
Definition: TrackBase.h:615
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
Definition: StudyHLT.cc:130
std::vector< double > tr_TrkPt
Definition: StudyHLT.cc:149
std::vector< double > tr_H3x3
Definition: StudyHLT.cc:151
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
const std::string theTrackQuality_
Definition: StudyHLT.cc:113
TH1I * h_HLTCorr
Definition: StudyHLT.cc:134
bool firstEvent_
Definition: StudyHLT.cc:121
TH1I * h_numberPV
Definition: StudyHLT.cc:134
TH1I * h_nHLT
Definition: StudyHLT.cc:134
const edm::InputTag triggerEvent_
Definition: StudyHLT.cc:118
const double tMinE_
Definition: StudyHLT.cc:115
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
std::vector< double > tr_MaxNearP31X31
Definition: StudyHLT.cc:150
TH1I * h_ntrk[2]
Definition: StudyHLT.cc:140
std::vector< TH1I * > h_HLTAccepts
Definition: StudyHLT.cc:137
std::vector< std::string > tr_TrigName
Definition: StudyHLT.cc:148
static const int nGen_
Definition: StudyHLT.cc:108
std::vector< bool > tr_SE7x7P
Definition: StudyHLT.cc:153
bool accept() const
Has at least one path accepted the event?
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
Definition: StudyHLT.cc:132
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::EDGetTokenT< reco::GenParticleCollection > tok_parts_
Definition: StudyHLT.cc:126
TH1I * h_HLTAccept
Definition: StudyHLT.cc:134
double weight() const
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:675
std::vector< std::string > HLTNames_
Definition: StudyHLT.cc:120
const double tMaxH_
Definition: StudyHLT.cc:115
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
static const int nPVBin_
Definition: StudyHLT.cc:107
std::vector< double > tr_TrkEta
Definition: StudyHLT.cc:149
const int verbosity_
Definition: StudyHLT.cc:111
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
Definition: StudyHLT.cc:127
TH1I * h_goodRun
Definition: StudyHLT.cc:135
void fillIsolation(int, double, double, double)
Definition: StudyHLT.cc:846
const double tMaxE_
Definition: StudyHLT.cc:115
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
Definition: StudyHLT.cc:131
double chargeIsolationEcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, bool debug=false)
int iEvent
Definition: GenABIO.cc:230
std::vector< int > tr_iEta
Definition: StudyHLT.cc:154
spr::trackSelectionParameters selectionParameters_
Definition: StudyHLT.cc:119
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
Definition: StudyHLT.cc:128
void fillTrack(int, double, double, double, double)
Definition: StudyHLT.cc:839
std::vector< double > tr_MaxNearHcalP7x7
Definition: StudyHLT.cc:150
std::string truncate_str(const std::string &)
Definition: StudyHLT.cc:872
TH1D * h_h_pNew[8]
Definition: StudyHLT.cc:139
const std::vector< double > puWeights_
Definition: StudyHLT.cc:117
T sqrt(T t)
Definition: SSEVec.h:18
unsigned int size() const
Get number of paths stored.
double pt() const
track transverse momentum
Definition: TrackBase.h:621
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int tr_goodRun
Definition: StudyHLT.cc:146
std::vector< bool > tr_SE11x11P
Definition: StudyHLT.cc:153
int pvBin_[nPVBin_+1]
Definition: StudyHLT.cc:144
static std::string const triggerResults
Definition: EdmProvDump.cc:41
bool isValid() const
Definition: HandleBase.h:74
int tr_goodPV
Definition: StudyHLT.cc:146
std::vector< double > tr_FE11x11P
Definition: StudyHLT.cc:152
#define M_PI
Definition: DetId.h:18
T const * product() const
Definition: Handle.h:81
void clear()
Definition: StudyHLT.cc:829
TH2I * h_nHLTvsRN
Definition: StudyHLT.cc:136
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
Definition: StudyHLT.cc:129
std::vector< int > tr_TrkID
Definition: StudyHLT.cc:154
int trackPID(const reco::Track *, const edm::Handle< reco::GenParticleCollection > &)
Definition: StudyHLT.cc:884
const double maxTrackEta_
Definition: StudyHLT.cc:114
TTree * tree_
Definition: StudyHLT.cc:143
TH1I * h_goodPV
Definition: StudyHLT.cc:135
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:510
std::vector< double > tr_H7x7
Definition: StudyHLT.cc:151
std::string const & label() const
Definition: InputTag.h:36
std::vector< double > tr_FE15x15P
Definition: StudyHLT.cc:152
double p1[4]
Definition: TauolaWrapper.h:89
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
Definition: StudyHLT.cc:125
double tr_eventWeight
Definition: StudyHLT.cc:147
reco::TrackBase::TrackQuality minQuality
const bool vetoTrigger_
Definition: StudyHLT.cc:116
const bool doTree_
Definition: StudyHLT.cc:116
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
const double minTrackP_
Definition: StudyHLT.cc:114
TH1D * h_counter[8]
Definition: StudyHLT.cc:138
std::vector< double > tr_FE7x7P
Definition: StudyHLT.cc:152
std::vector< double > tr_TrkPhi
Definition: StudyHLT.cc:149
double chargeIsolationHcal(unsigned int trkIndex, std::vector< spr::propagatedTrackID > &vdetIds, const HcalTopology *topology, int ieta, int iphi, bool debug=false)
std::vector< double > tr_TrkP
Definition: StudyHLT.cc:149
T const * product() const
Definition: ESHandle.h:86
std::vector< bool > tr_SE15x15P
Definition: StudyHLT.cc:153
const std::vector< std::string > trigNames_
Definition: StudyHLT.cc:112
std::vector< double > tr_H5x5
Definition: StudyHLT.cc:151
int nRun_
Definition: StudyHLT.cc:144
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
Definition: StudyHLT.cc:124
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
const std::vector< std::string > newNames_
Definition: StudyHLT.cc:112
double eHCALmatrix(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int useRaw=0, bool debug=false)
void StudyHLT::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 637 of file StudyHLT.cc.

References doTree_, etaBin_, fs_, h_counter, h_ediff, h_ene1, h_ene2, h_energy, h_eta, h_goodPV, h_goodRun, h_h_pNew, h_HLTAccept, h_HLTCorr, h_maxNearP, h_nHLT, h_nHLTvsRN, h_ntrk, h_numberPV, h_p, h_phi, h_pt, mps_fire::i, TFileService::make(), nEtaBin_, nGen_, nPBin_, nPVBin_, pBin_, pvBin_, AlCaHLTBitMon_QueryRunRegistry::string, tr_eventWeight, tr_FE11x11P, tr_FE15x15P, tr_FE7x7P, tr_goodPV, tr_goodRun, tr_H3x3, tr_H5x5, tr_H7x7, tr_iEta, tr_MaxNearHcalP7x7, tr_MaxNearP31X31, tr_SE11x11P, tr_SE15x15P, tr_SE7x7P, tr_TrigName, tr_TrkEta, tr_TrkID, tr_TrkP, tr_TrkPhi, tr_TrkPt, and tree_.

Referenced by ~StudyHLT().

637  {
638  // Book histograms
639  h_nHLT = fs_->make<TH1I>("h_nHLT" , "size of trigger Names", 1000, 0, 1000);
640  h_HLTAccept = fs_->make<TH1I>("h_HLTAccept", "HLT Accepts for all runs", 500, 0, 500);
641  for (int i=1; i<=500; ++i) h_HLTAccept->GetXaxis()->SetBinLabel(i," ");
642  h_nHLTvsRN = fs_->make<TH2I>("h_nHLTvsRN" , "size of trigger Names vs RunNo", 2168, 190949, 193116, 100, 400, 500);
643  h_HLTCorr = fs_->make<TH1I>("h_HLTCorr", "Correlation among different paths", 100, 0, 100);
644  h_numberPV = fs_->make<TH1I>("h_numberPV", "Number of Primary Vertex", 100, 0, 100);
645  h_goodPV = fs_->make<TH1I>("h_goodPV", "Number of good Primary Vertex", 100, 0, 100);
646  h_goodRun = fs_->make<TH1I>("h_goodRun","Number of accepted events for Run", 4000, 190000, 1940000);
647  char hname[60], htit[200];
648  std::string CollectionNames[2] = {"Reco", "Propagated"};
649  for (unsigned int i=0; i<2; i++) {
650  sprintf(hname, "h_nTrk_%s", CollectionNames[i].c_str());
651  sprintf(htit, "Number of %s tracks", CollectionNames[i].c_str());
652  h_ntrk[i] = fs_->make<TH1I>(hname, htit, 500, 0, 500);
653  }
654  std::string TrkNames[8] = {"All", "Quality", "NoIso", "okEcal", "EcalCharIso", "HcalCharIso", "EcalNeutIso", "HcalNeutIso"};
655  std::string particle[4] = {"Electron", "Pion", "Kaon", "Proton"};
656  for (unsigned int i=0; i<=nGen_+1; i++) {
657  if (i < 8) {
658  sprintf(hname, "h_pt_%s", TrkNames[i].c_str());
659  sprintf(htit, "p_{T} of %s tracks", TrkNames[i].c_str());
660  } else if (i < 8+nPVBin_) {
661  sprintf(hname, "h_pt_%s_%d", TrkNames[7].c_str(), i-8);
662  sprintf(htit, "p_{T} of %s tracks (PV=%d:%d)", TrkNames[7].c_str(), pvBin_[i-8], pvBin_[i-7]-1);
663  } else if (i >= nGen_) {
664  sprintf(hname, "h_pt_%s_%d", TrkNames[0].c_str(), i-nGen_);
665  sprintf(htit, "p_{T} of %s Generator tracks", TrkNames[0].c_str());
666  } else {
667  sprintf(hname, "h_pt_%s_%s", TrkNames[7].c_str(), particle[i-8-nPVBin_].c_str());
668  sprintf(htit, "p_{T} of %s tracks (%s)", TrkNames[7].c_str(), particle[i-8-nPVBin_].c_str());
669  }
670  h_pt[i] = fs_->make<TH1D>(hname, htit, 400, 0, 200.0);
671  h_pt[i]->Sumw2();
672 
673  if (i < 8) {
674  sprintf(hname, "h_p_%s", TrkNames[i].c_str());
675  sprintf(htit, "Momentum of %s tracks", TrkNames[i].c_str());
676  } else if (i < 8+nPVBin_) {
677  sprintf(hname, "h_p_%s_%d", TrkNames[7].c_str(), i-8);
678  sprintf(htit, "Momentum of %s tracks (PV=%d:%d)", TrkNames[7].c_str(), pvBin_[i-8], pvBin_[i-7]-1);
679  } else if (i >= nGen_) {
680  sprintf(hname, "h_p_%s_%d", TrkNames[0].c_str(), i-nGen_);
681  sprintf(htit, "Momentum of %s Generator tracks", TrkNames[0].c_str());
682  } else {
683  sprintf(hname, "h_p_%s_%s", TrkNames[7].c_str(), particle[i-8-nPVBin_].c_str());
684  sprintf(htit, "Momentum of %s tracks (%s)", TrkNames[7].c_str(), particle[i-8-nPVBin_].c_str());
685  }
686  h_p[i] = fs_->make<TH1D>(hname, htit, 400, 0, 200.0);
687  h_p[i]->Sumw2();
688 
689  if (i < 8) {
690  sprintf(hname, "h_eta_%s", TrkNames[i].c_str());
691  sprintf(htit, "Eta of %s tracks", TrkNames[i].c_str());
692  } else if (i < 8+nPVBin_) {
693  sprintf(hname, "h_eta_%s_%d", TrkNames[7].c_str(), i-8);
694  sprintf(htit, "Eta of %s tracks (PV=%d:%d)", TrkNames[7].c_str(), pvBin_[i-8], pvBin_[i-7]-1);
695  } else if (i >= nGen_) {
696  sprintf(hname, "h_eta_%s_%d", TrkNames[0].c_str(), i-nGen_);
697  sprintf(htit, "Eta of %s Generator tracks", TrkNames[0].c_str());
698  } else {
699  sprintf(hname, "h_eta_%s_%s", TrkNames[7].c_str(), particle[i-8-nPVBin_].c_str());
700  sprintf(htit, "Eta of %s tracks (%s)", TrkNames[7].c_str(), particle[i-8-nPVBin_].c_str());
701  }
702  h_eta[i] = fs_->make<TH1D>(hname, htit, 60, -3.0, 3.0);
703  h_eta[i]->Sumw2();
704 
705  if (i < 8) {
706  sprintf(hname, "h_phi_%s", TrkNames[i].c_str());
707  sprintf(htit, "Phi of %s tracks", TrkNames[i].c_str());
708  } else if (i < 8+nPVBin_) {
709  sprintf(hname, "h_phi_%s_%d", TrkNames[7].c_str(), i-8);
710  sprintf(htit, "Phi of %s tracks (PV=%d:%d)", TrkNames[7].c_str(), pvBin_[i-8], pvBin_[i-7]-1);
711  } else if (i >= nGen_) {
712  sprintf(hname, "h_phi_%s_%d", TrkNames[0].c_str(), i-nGen_);
713  sprintf(htit, "Phi of %s Generator tracks", TrkNames[0].c_str());
714  } else {
715  sprintf(hname, "h_phi_%s_%s", TrkNames[7].c_str(), particle[i-8-nPVBin_].c_str());
716  sprintf(htit, "Phi of %s tracks (%s)", TrkNames[7].c_str(), particle[i-8-nPVBin_].c_str());
717  }
718  h_phi[i] = fs_->make<TH1D>(hname, htit, 100, -3.15, 3.15);
719  h_phi[i]->Sumw2();
720  }
721  std::string IsolationNames[2] = {"Ecal", "Hcal"};
722  for (unsigned int i=0; i<2; i++) {
723  sprintf(hname, "h_maxNearP_%s", IsolationNames[i].c_str());
724  sprintf(htit, "Energy in ChargeIso region for %s", IsolationNames[i].c_str());
725  h_maxNearP[i] = fs_->make<TH1D>(hname, htit, 120, -1.5, 10.5);
726  h_maxNearP[i]->Sumw2();
727 
728  sprintf(hname, "h_ene1_%s", IsolationNames[i].c_str());
729  sprintf(htit, "Energy in smaller cone for %s", IsolationNames[i].c_str());
730  h_ene1[i] = fs_->make<TH1D>(hname, htit, 400, 0.0, 200.0);
731  h_ene1[i]->Sumw2();
732 
733  sprintf(hname, "h_ene2_%s", IsolationNames[i].c_str());
734  sprintf(htit, "Energy in bigger cone for %s", IsolationNames[i].c_str());
735  h_ene2[i] = fs_->make<TH1D>(hname, htit, 400, 0.0, 200.0);
736  h_ene2[i]->Sumw2();
737 
738  sprintf(hname, "h_ediff_%s", IsolationNames[i].c_str());
739  sprintf(htit, "Energy in NeutralIso region for %s", IsolationNames[i].c_str());
740  h_ediff[i] = fs_->make<TH1D>(hname, htit, 100, -0.5, 19.5);
741  h_ediff[i]->Sumw2();
742  }
743  std::string energyNames[6]={"E_{7x7}", "H_{3x3}", "(E_{7x7}+H_{3x3})",
744  "E_{11x11}", "H_{5x5}", "{E_{11x11}+H_{5x5})"};
745  for (int i=0; i<4+nPVBin_+4; ++i) {
746  for (int ip=0; ip<nPBin_; ++ip) {
747  for (int ie=0; ie<nEtaBin_; ++ie) {
748  for (int j=0; j<6; ++j) {
749  sprintf(hname, "h_energy_%d_%d_%d_%d", i, ip, ie, j);
750  if (i < 4) {
751  sprintf(htit,"%s/p (p=%4.1f:%4.1f; i#eta=%d:%d) for tracks with %s",
752  energyNames[j].c_str(),pBin_[ip],pBin_[ip+1],etaBin_[ie],
753  (etaBin_[ie+1]-1), TrkNames[i+4].c_str());
754  } else if (i < 4+nPVBin_) {
755  sprintf(htit,"%s/p (p=%4.1f:%4.1f, i#eta=%d:%d, PV=%d:%d) for tracks with %s",
756  energyNames[j].c_str(),pBin_[ip],pBin_[ip+1],etaBin_[ie],
757  (etaBin_[ie+1]-1), pvBin_[i-4], pvBin_[i-3],
758  TrkNames[7].c_str());
759  } else {
760  sprintf(htit,"%s/p (p=%4.1f:%4.1f, i#eta=%d:%d %s) for tracks with %s",
761  energyNames[j].c_str(),pBin_[ip],pBin_[ip+1],etaBin_[ie],
762  (etaBin_[ie+1]-1), particle[i-4-nPVBin_].c_str(),
763  TrkNames[7].c_str());
764  }
765  h_energy[i][ip][ie][j] = fs_->make<TH1D>(hname, htit, 5000,-0.1,49.9);
766  h_energy[i][ip][ie][j]->Sumw2();
767  }
768  }
769  }
770  }
771 
772  for (int i=0; i<8; ++i) {
773  sprintf(hname,"counter%d",i);
774  sprintf(htit,"Counter with cut %d",i);
775  h_counter[i] = fs_->make<TH1D>(hname, htit, 1000, 0, 1000);
776  sprintf(hname,"h_pTNew%d",i);
777  sprintf(htit,"Track momentum with cut %d",i);
778  h_h_pNew[i] = fs_->make<TH1D>(hname, htit, 1000, 0, 1000);
779  }
780 
781  // Now the tree
782  if (doTree_) {
783  tree_ = fs_->make<TTree>("testTree", "new HLT Tree");
784  tree_->Branch("tr_goodRun", &tr_goodRun, "tr_goodRun/I");
785  tree_->Branch("tr_goodPV", &tr_goodPV, "tr_goodPV/I");
786  tree_->Branch("tr_eventWeight", &tr_eventWeight, "tr_eventWeight/D");
787  tree_->Branch("tr_tr_TrigName", &tr_TrigName);
788  tree_->Branch("tr_TrkPt", &tr_TrkPt);
789  tree_->Branch("tr_TrkP", &tr_TrkP);
790  tree_->Branch("tr_TrkEta", &tr_TrkEta);
791  tree_->Branch("tr_TrkPhi", &tr_TrkPhi);
792  tree_->Branch("tr_TrkID", &tr_TrkID);
793  tree_->Branch("tr_MaxNearP31X31", &tr_MaxNearP31X31);
794  tree_->Branch("tr_MaxNearHcalP7x7", &tr_MaxNearHcalP7x7);
795  tree_->Branch("tr_FE7x7P", &tr_FE7x7P);
796  tree_->Branch("tr_FE11x11P", &tr_FE11x11P);
797  tree_->Branch("tr_FE15x15P", &tr_FE15x15P);
798  tree_->Branch("tr_SE7x7P", &tr_SE7x7P);
799  tree_->Branch("tr_SE11x11P", &tr_SE11x11P);
800  tree_->Branch("tr_SE15x15P", &tr_SE15x15P);
801  tree_->Branch("tr_H3x3", &tr_H3x3);
802  tree_->Branch("tr_H5x5", &tr_H5x5);
803  tree_->Branch("tr_H7x7", &tr_H7x7);
804  tree_->Branch("tr_iEta", &tr_iEta);
805  }
806 }
std::vector< double > tr_TrkPt
Definition: StudyHLT.cc:149
std::vector< double > tr_H3x3
Definition: StudyHLT.cc:151
TH1I * h_HLTCorr
Definition: StudyHLT.cc:134
TH1I * h_numberPV
Definition: StudyHLT.cc:134
TH1I * h_nHLT
Definition: StudyHLT.cc:134
std::vector< double > tr_MaxNearP31X31
Definition: StudyHLT.cc:150
TH1I * h_ntrk[2]
Definition: StudyHLT.cc:140
std::vector< std::string > tr_TrigName
Definition: StudyHLT.cc:148
static const int nGen_
Definition: StudyHLT.cc:108
std::vector< bool > tr_SE7x7P
Definition: StudyHLT.cc:153
static const int nPBin_
Definition: StudyHLT.cc:107
TH1D * h_phi[nGen_+2]
Definition: StudyHLT.cc:139
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
TH1I * h_HLTAccept
Definition: StudyHLT.cc:134
static const int nPVBin_
Definition: StudyHLT.cc:107
std::vector< double > tr_TrkEta
Definition: StudyHLT.cc:149
TH1I * h_goodRun
Definition: StudyHLT.cc:135
TH1D * h_ene2[2]
Definition: StudyHLT.cc:141
TH1D * h_pt[nGen_+2]
Definition: StudyHLT.cc:138
TH1D * h_energy[nPVBin_+8][nPBin_][nEtaBin_][6]
Definition: StudyHLT.cc:142
int etaBin_[nEtaBin_+1]
Definition: StudyHLT.cc:144
std::vector< int > tr_iEta
Definition: StudyHLT.cc:154
std::vector< double > tr_MaxNearHcalP7x7
Definition: StudyHLT.cc:150
TH1D * h_h_pNew[8]
Definition: StudyHLT.cc:139
TH1D * h_ene1[2]
Definition: StudyHLT.cc:141
static const int nEtaBin_
Definition: StudyHLT.cc:107
int tr_goodRun
Definition: StudyHLT.cc:146
std::vector< bool > tr_SE11x11P
Definition: StudyHLT.cc:153
int pvBin_[nPVBin_+1]
Definition: StudyHLT.cc:144
TH1D * h_ediff[2]
Definition: StudyHLT.cc:141
int tr_goodPV
Definition: StudyHLT.cc:146
std::vector< double > tr_FE11x11P
Definition: StudyHLT.cc:152
edm::Service< TFileService > fs_
Definition: StudyHLT.cc:110
TH1D * h_maxNearP[2]
Definition: StudyHLT.cc:141
TH2I * h_nHLTvsRN
Definition: StudyHLT.cc:136
std::vector< int > tr_TrkID
Definition: StudyHLT.cc:154
TTree * tree_
Definition: StudyHLT.cc:143
TH1I * h_goodPV
Definition: StudyHLT.cc:135
std::vector< double > tr_H7x7
Definition: StudyHLT.cc:151
std::vector< double > tr_FE15x15P
Definition: StudyHLT.cc:152
double pBin_[nPBin_+1]
Definition: StudyHLT.cc:145
double tr_eventWeight
Definition: StudyHLT.cc:147
const bool doTree_
Definition: StudyHLT.cc:116
TH1D * h_eta[nGen_+2]
Definition: StudyHLT.cc:139
TH1D * h_counter[8]
Definition: StudyHLT.cc:138
std::vector< double > tr_FE7x7P
Definition: StudyHLT.cc:152
std::vector< double > tr_TrkPhi
Definition: StudyHLT.cc:149
std::vector< double > tr_TrkP
Definition: StudyHLT.cc:149
std::vector< bool > tr_SE15x15P
Definition: StudyHLT.cc:153
TH1D * h_p[nGen_+2]
Definition: StudyHLT.cc:138
std::vector< double > tr_H5x5
Definition: StudyHLT.cc:151
virtual void StudyHLT::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
inlineprivatevirtual

Definition at line 95 of file StudyHLT.cc.

95 { }
void StudyHLT::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 809 of file StudyHLT.cc.

References changed_, firstEvent_, fs_, h_HLTAccepts, hltConfig_, mps_fire::i, HLTConfigProvider::init(), TFileService::make(), nRun_, and edm::RunBase::run().

Referenced by ~StudyHLT().

809  {
810  char hname[100], htit[400];
811  edm::LogInfo("IsoTrack") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init "
812  << hltConfig_.init(iRun,iSetup,"HLT",changed_);
813  sprintf(hname, "h_HLTAccepts_%i", iRun.run());
814  sprintf(htit, "HLT Accepts for Run No %i", iRun.run());
815  TH1I *hnew = fs_->make<TH1I>(hname, htit, 500, 0, 500);
816  for (int i=1; i<=500; ++i) hnew->GetXaxis()->SetBinLabel(i," ");
817  h_HLTAccepts.push_back(hnew);
818  edm::LogInfo("IsoTrack") << "beginrun " << iRun.run();
819  firstEvent_ = true;
820  changed_ = false;
821 }
bool firstEvent_
Definition: StudyHLT.cc:121
std::vector< TH1I * > h_HLTAccepts
Definition: StudyHLT.cc:137
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
bool changed_
Definition: StudyHLT.cc:121
HLTConfigProvider hltConfig_
Definition: StudyHLT.cc:109
edm::Service< TFileService > fs_
Definition: StudyHLT.cc:110
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
int nRun_
Definition: StudyHLT.cc:144
void StudyHLT::clear ( void  )
private

Definition at line 829 of file StudyHLT.cc.

References tr_FE11x11P, tr_FE15x15P, tr_FE7x7P, tr_H3x3, tr_H5x5, tr_H7x7, tr_iEta, tr_MaxNearHcalP7x7, tr_MaxNearP31X31, tr_SE11x11P, tr_SE15x15P, tr_SE7x7P, tr_TrigName, tr_TrkEta, tr_TrkID, tr_TrkP, tr_TrkPhi, and tr_TrkPt.

Referenced by analyze(), Vispa.Views.WidgetView.WidgetView::closeEvent(), Vispa.Views.BoxDecayView.BoxDecayView::closeEvent(), endLuminosityBlock(), Vispa.Share.FindAlgorithm.FindAlgorithm::findUsingFindDialog(), Vispa.Views.LineDecayView.LineDecayView::setDataObjects(), Vispa.Views.WidgetView.WidgetView::setDataObjects(), BeautifulSoup.Tag::setString(), Vispa.Views.TreeView.TreeView::updateContent(), Vispa.Views.TableView.TableView::updateContent(), Vispa.Views.BoxDecayView.BoxDecayView::updateContent(), and Vispa.Views.PropertyView.PropertyView::updateContent().

829  {
830  tr_TrigName.clear();
831  tr_TrkPt.clear(); tr_TrkP.clear(); tr_TrkEta.clear(); tr_TrkPhi.clear();
832  tr_TrkID.clear(); tr_MaxNearP31X31.clear(); tr_MaxNearHcalP7x7.clear();
833  tr_FE7x7P.clear(); tr_FE11x11P.clear(); tr_FE15x15P.clear();
834  tr_SE7x7P.clear(); tr_SE11x11P.clear(); tr_SE15x15P.clear();
835  tr_H3x3.clear(); tr_H5x5.clear(); tr_H7x7.clear();
836  tr_iEta.clear();
837 }
std::vector< double > tr_TrkPt
Definition: StudyHLT.cc:149
std::vector< double > tr_H3x3
Definition: StudyHLT.cc:151
std::vector< double > tr_MaxNearP31X31
Definition: StudyHLT.cc:150
std::vector< std::string > tr_TrigName
Definition: StudyHLT.cc:148
std::vector< bool > tr_SE7x7P
Definition: StudyHLT.cc:153
std::vector< double > tr_TrkEta
Definition: StudyHLT.cc:149
std::vector< int > tr_iEta
Definition: StudyHLT.cc:154
std::vector< double > tr_MaxNearHcalP7x7
Definition: StudyHLT.cc:150
std::vector< bool > tr_SE11x11P
Definition: StudyHLT.cc:153
std::vector< double > tr_FE11x11P
Definition: StudyHLT.cc:152
std::vector< int > tr_TrkID
Definition: StudyHLT.cc:154
std::vector< double > tr_H7x7
Definition: StudyHLT.cc:151
std::vector< double > tr_FE15x15P
Definition: StudyHLT.cc:152
std::vector< double > tr_FE7x7P
Definition: StudyHLT.cc:152
std::vector< double > tr_TrkPhi
Definition: StudyHLT.cc:149
std::vector< double > tr_TrkP
Definition: StudyHLT.cc:149
std::vector< bool > tr_SE15x15P
Definition: StudyHLT.cc:153
std::vector< double > tr_H5x5
Definition: StudyHLT.cc:151
virtual void StudyHLT::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
inlineprivatevirtual
void StudyHLT::endRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivate

Definition at line 824 of file StudyHLT.cc.

References nRun_, and edm::RunBase::run().

Referenced by ~StudyHLT().

824  {
825  ++nRun_;
826  edm::LogInfo("IsoTrack") << "endrun[" << nRun_ << "] " << iRun.run();
827 }
int nRun_
Definition: StudyHLT.cc:144
void StudyHLT::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 240 of file StudyHLT.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), AlCaHLTBitMon_QueryRunRegistry::string, and create_public_lumi_plots::weights.

Referenced by ~StudyHLT().

240  {
241  std::vector<std::string> trig;
242  std::vector<double> weights;
243  std::vector<std::string> newNames = {"HLT", "PixelTracks_Multiplicity",
244  "HLT_Physics_","HLT_JetE",
245  "HLT_ZeroBias"};
247  desc.add<edm::InputTag>("particleSource",edm::InputTag("genParticles"));
248  desc.addUntracked<int>("verbosity", 0);
249  desc.addUntracked<std::vector<std::string> >("triggers",trig);
250  desc.addUntracked<std::vector<std::string> >("newNames",newNames);
251  desc.addUntracked<std::string>("trackQuality","highPurity");
252  desc.addUntracked<double>("minTrackPt", 1.0);
253  desc.addUntracked<double>("maxDxyPV", 0.02);
254  desc.addUntracked<double>("maxDzPV", 0.02);
255  desc.addUntracked<double>("maxChi2", 5.0);
256  desc.addUntracked<double>("maxDpOverP", 0.1);
257  desc.addUntracked<int>("minOuterHit", 4);
258  desc.addUntracked<int>("minLayerCrossed", 8);
259  desc.addUntracked<int>("maxInMiss", 0);
260  desc.addUntracked<int>("maxOutMiss", 0);
261  desc.addUntracked<double>("minTrackP", 1.0);
262  desc.addUntracked<double>("maxTrackEta", 2.6);
263  desc.addUntracked<double>("timeMinCutECAL",-500.0);
264  desc.addUntracked<double>("timeMaxCutECAL", 500.0);
265  desc.addUntracked<double>("timeMinCutHCAL",-500.0);
266  desc.addUntracked<double>("timeMaxCutHCAL", 500.0);
267  desc.addUntracked<bool>("isItAOD", false);
268  desc.addUntracked<bool>("vetoTrigger", false);
269  desc.addUntracked<bool>("doTree", false);
270  desc.addUntracked<std::vector<double> >("puWeights", weights);
271  descriptions.add("studyHLT",desc);
272 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void StudyHLT::fillEnergy ( int  flag,
int  ieta,
double  p,
double  enEcal1,
double  enHcal1,
double  enEcal2,
double  enHcal2 
)
private

Definition at line 853 of file StudyHLT.cc.

References etaBin_, RemoveAddSevLevel::flag, h_energy, mps_fire::i, nEtaBin_, nPBin_, pBin_, and tr_eventWeight.

Referenced by analyze(), and endLuminosityBlock().

854  {
855  int ip(-1), ie(-1);
856  for (int i=0; i<nPBin_; ++i) {
857  if (p >= pBin_[i] && p < pBin_[i+1]) { ip = i; break; }
858  }
859  for (int i=0; i<nEtaBin_; ++i) {
860  if (ieta >= etaBin_[i] && ieta < etaBin_[i+1]) { ie = i; break; }
861  }
862  if (ip >= 0 && ie >= 0 && enEcal1 > 0.02 && enHcal1 > 0.1) {
863  h_energy[flag][ip][ie][0]->Fill(enEcal1/p,tr_eventWeight);
864  h_energy[flag][ip][ie][1]->Fill(enHcal1/p,tr_eventWeight);
865  h_energy[flag][ip][ie][2]->Fill((enEcal1+enHcal1)/p,tr_eventWeight);
866  h_energy[flag][ip][ie][3]->Fill(enEcal2/p,tr_eventWeight);
867  h_energy[flag][ip][ie][4]->Fill(enHcal2/p,tr_eventWeight);
868  h_energy[flag][ip][ie][5]->Fill((enEcal2+enHcal2)/p,tr_eventWeight);
869  }
870 }
static const int nPBin_
Definition: StudyHLT.cc:107
TH1D * h_energy[nPVBin_+8][nPBin_][nEtaBin_][6]
Definition: StudyHLT.cc:142
int etaBin_[nEtaBin_+1]
Definition: StudyHLT.cc:144
static const int nEtaBin_
Definition: StudyHLT.cc:107
double pBin_[nPBin_+1]
Definition: StudyHLT.cc:145
double tr_eventWeight
Definition: StudyHLT.cc:147
void StudyHLT::fillIsolation ( int  i,
double  emaxnearP,
double  eneutIso1,
double  eneutIso2 
)
private

Definition at line 846 of file StudyHLT.cc.

References h_ediff, h_ene1, h_ene2, h_maxNearP, mps_fire::i, and tr_eventWeight.

Referenced by analyze(), and endLuminosityBlock().

846  {
847  h_maxNearP[i]->Fill(emaxnearP,tr_eventWeight);
848  h_ene1[i]->Fill(eneutIso1,tr_eventWeight);
849  h_ene2[i]->Fill(eneutIso2,tr_eventWeight);
850  h_ediff[i]->Fill(eneutIso2-eneutIso1,tr_eventWeight);
851 }
TH1D * h_ene2[2]
Definition: StudyHLT.cc:141
TH1D * h_ene1[2]
Definition: StudyHLT.cc:141
TH1D * h_ediff[2]
Definition: StudyHLT.cc:141
TH1D * h_maxNearP[2]
Definition: StudyHLT.cc:141
double tr_eventWeight
Definition: StudyHLT.cc:147
void StudyHLT::fillTrack ( int  i,
double  pt,
double  p,
double  eta,
double  phi 
)
private

Definition at line 839 of file StudyHLT.cc.

References h_eta, h_p, h_phi, h_pt, mps_fire::i, and tr_eventWeight.

Referenced by analyze(), and endLuminosityBlock().

839  {
840  h_pt[i]->Fill(pt,tr_eventWeight);
841  h_p[i]->Fill(p,tr_eventWeight);
842  h_eta[i]->Fill(eta,tr_eventWeight);
843  h_phi[i]->Fill(phi,tr_eventWeight);
844 }
TH1D * h_phi[nGen_+2]
Definition: StudyHLT.cc:139
TH1D * h_pt[nGen_+2]
Definition: StudyHLT.cc:138
double tr_eventWeight
Definition: StudyHLT.cc:147
TH1D * h_eta[nGen_+2]
Definition: StudyHLT.cc:139
TH1D * h_p[nGen_+2]
Definition: StudyHLT.cc:138
int StudyHLT::trackPID ( const reco::Track pTrack,
const edm::Handle< reco::GenParticleCollection > &  genParticles 
)
private

Definition at line 884 of file StudyHLT.cc.

References funct::abs(), DEFINE_FWK_MODULE, particleFlow_cfi::dEta, particleFlow_cfi::dPhi, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, reco::TrackBase::eta(), triggerObjects_cff::id, training_settings::idx, edm::HandleBase::isValid(), M_PI, AlCaHLTBitMon_ParallelJobs::p, common_cff::pdgId, reco::TrackBase::phi(), and mathSSE::sqrt().

Referenced by analyze(), and endLuminosityBlock().

884  {
885  int id(0);
886  if (genParticles.isValid()) {
887  unsigned int indx;
888  reco::GenParticleCollection::const_iterator p;
889  double mindR(999.9);
890  for (p=genParticles->begin(),indx=0; p!=genParticles->end(); ++p,++indx) {
891  int pdgId = std::abs(p->pdgId());
892  int idx = (pdgId == 11) ? 1 :
893  ((pdgId == 211) ? 2 : ((pdgId == 321) ? 3 : ((pdgId == 2212) ? 4 : 0)));
894  if (idx > 0) {
895  double dEta = pTrack->eta() - p->momentum().Eta();
896  double phi1 = pTrack->phi();
897  double phi2 = p->momentum().Phi();
898  if (phi1 < 0) phi1 += 2.0*M_PI;
899  if (phi2 < 0) phi2 += 2.0*M_PI;
900  double dPhi = phi1-phi2;
901  if (dPhi > M_PI) dPhi -= 2.*M_PI;
902  else if (dPhi < -M_PI) dPhi += 2.*M_PI;
903  double dR = sqrt(dEta*dEta+dPhi*dPhi);
904  if (dR < mindR) {
905  mindR = dR; id = idx;
906  }
907  }
908  }
909  }
910  return id;
911 }
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:645
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
T sqrt(T t)
Definition: SSEVec.h:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:74
#define M_PI
std::string StudyHLT::truncate_str ( const std::string &  str)
private

Definition at line 872 of file StudyHLT.cc.

References mps_fire::i, AlCaHLTBitMon_QueryRunRegistry::string, and z.

Referenced by analyze(), and endLuminosityBlock().

872  {
873  std::string truncated_str(str);
874  int length = str.length();
875  for (int i=0; i<length-2; i++){
876  if (str[i]=='_' && str[i+1]=='v' && isdigit(str.at(i+2))) {
877  int z = i+1;
878  truncated_str = str.substr(0,z);
879  }
880  }
881  return(truncated_str);
882 }
#define str(s)

Member Data Documentation

bool StudyHLT::changed_
private

Definition at line 121 of file StudyHLT.cc.

Referenced by beginRun(), and StudyHLT().

const bool StudyHLT::doTree_
private

Definition at line 116 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and StudyHLT().

int StudyHLT::etaBin_[nEtaBin_+1]
private

Definition at line 144 of file StudyHLT.cc.

Referenced by beginJob(), fillEnergy(), and StudyHLT().

bool StudyHLT::firstEvent_
private

Definition at line 121 of file StudyHLT.cc.

Referenced by analyze(), beginRun(), and StudyHLT().

edm::Service<TFileService> StudyHLT::fs_
private

Definition at line 110 of file StudyHLT.cc.

Referenced by beginJob(), and beginRun().

TH1D * StudyHLT::h_counter[8]
private

Definition at line 138 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

TH1D * StudyHLT::h_ediff[2]
private

Definition at line 141 of file StudyHLT.cc.

Referenced by beginJob(), and fillIsolation().

TH1D * StudyHLT::h_ene1[2]
private

Definition at line 141 of file StudyHLT.cc.

Referenced by beginJob(), and fillIsolation().

TH1D * StudyHLT::h_ene2[2]
private

Definition at line 141 of file StudyHLT.cc.

Referenced by beginJob(), and fillIsolation().

TH1D* StudyHLT::h_energy[nPVBin_+8][nPBin_][nEtaBin_][6]
private

Definition at line 142 of file StudyHLT.cc.

Referenced by beginJob(), and fillEnergy().

TH1D* StudyHLT::h_eta[nGen_+2]
private

Definition at line 139 of file StudyHLT.cc.

Referenced by beginJob(), and fillTrack().

TH1I* StudyHLT::h_goodPV
private

Definition at line 135 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

TH1I * StudyHLT::h_goodRun
private

Definition at line 135 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

TH1D * StudyHLT::h_h_pNew[8]
private

Definition at line 139 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

TH1I * StudyHLT::h_HLTAccept
private

Definition at line 134 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

std::vector<TH1I*> StudyHLT::h_HLTAccepts
private

Definition at line 137 of file StudyHLT.cc.

Referenced by analyze(), and beginRun().

TH1I * StudyHLT::h_HLTCorr
private

Definition at line 134 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

TH1D* StudyHLT::h_maxNearP[2]
private

Definition at line 141 of file StudyHLT.cc.

Referenced by beginJob(), and fillIsolation().

TH1I* StudyHLT::h_nHLT
private

Definition at line 134 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

TH2I* StudyHLT::h_nHLTvsRN
private

Definition at line 136 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

TH1I* StudyHLT::h_ntrk[2]
private

Definition at line 140 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

TH1I * StudyHLT::h_numberPV
private

Definition at line 134 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

TH1D* StudyHLT::h_p[nGen_+2]
private

Definition at line 138 of file StudyHLT.cc.

Referenced by beginJob(), and fillTrack().

TH1D * StudyHLT::h_phi[nGen_+2]
private

Definition at line 139 of file StudyHLT.cc.

Referenced by beginJob(), and fillTrack().

TH1D * StudyHLT::h_pt[nGen_+2]
private

Definition at line 138 of file StudyHLT.cc.

Referenced by beginJob(), and fillTrack().

HLTConfigProvider StudyHLT::hltConfig_
private

Definition at line 109 of file StudyHLT.cc.

Referenced by beginRun().

std::vector<std::string> StudyHLT::HLTNames_
private

Definition at line 120 of file StudyHLT.cc.

Referenced by analyze().

const bool StudyHLT::isItAOD_
private

Definition at line 116 of file StudyHLT.cc.

Referenced by StudyHLT().

const double StudyHLT::maxTrackEta_
private

Definition at line 114 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

const double StudyHLT::minTrackP_
private

Definition at line 114 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

const int StudyHLT::nEtaBin_ =4
staticprivate

Definition at line 107 of file StudyHLT.cc.

Referenced by beginJob(), fillEnergy(), and StudyHLT().

const std::vector<std::string> StudyHLT::newNames_
private

Definition at line 112 of file StudyHLT.cc.

Referenced by analyze().

const int StudyHLT::nGen_ =(nPVBin_+12)
staticprivate

Definition at line 108 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

const int StudyHLT::nPBin_ =15
staticprivate

Definition at line 107 of file StudyHLT.cc.

Referenced by beginJob(), fillEnergy(), and StudyHLT().

const int StudyHLT::nPVBin_ =4
staticprivate

Definition at line 107 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and StudyHLT().

int StudyHLT::nRun_
private

Definition at line 144 of file StudyHLT.cc.

Referenced by analyze(), beginRun(), and endRun().

double StudyHLT::pBin_[nPBin_+1]
private

Definition at line 145 of file StudyHLT.cc.

Referenced by beginJob(), fillEnergy(), and StudyHLT().

const std::vector<double> StudyHLT::puWeights_
private

Definition at line 117 of file StudyHLT.cc.

Referenced by analyze().

int StudyHLT::pvBin_[nPVBin_+1]
private

Definition at line 144 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and StudyHLT().

spr::trackSelectionParameters StudyHLT::selectionParameters_
private

Definition at line 119 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

const std::string StudyHLT::theTrackQuality_
private

Definition at line 113 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

const edm::InputTag StudyHLT::theTriggerResultsLabel_
private

Definition at line 118 of file StudyHLT.cc.

Referenced by StudyHLT().

const double StudyHLT::tMaxE_
private

Definition at line 115 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

const double StudyHLT::tMaxH_
private

Definition at line 115 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

const double StudyHLT::tMinE_
private

Definition at line 115 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

const double StudyHLT::tMinH_
private

Definition at line 115 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

edm::EDGetTokenT<EcalRecHitCollection> StudyHLT::tok_EB_
private

Definition at line 129 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

edm::EDGetTokenT<EcalRecHitCollection> StudyHLT::tok_EE_
private

Definition at line 130 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

edm::EDGetTokenT<GenEventInfoProduct> StudyHLT::tok_ew_
private

Definition at line 132 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

edm::EDGetTokenT<reco::TrackCollection> StudyHLT::tok_genTrack_
private

Definition at line 127 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

edm::EDGetTokenT<HBHERecHitCollection> StudyHLT::tok_hbhe_
private

Definition at line 131 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

edm::EDGetTokenT<LumiDetails> StudyHLT::tok_lumi
private

Definition at line 123 of file StudyHLT.cc.

Referenced by StudyHLT().

edm::EDGetTokenT<reco::GenParticleCollection> StudyHLT::tok_parts_
private

Definition at line 126 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

edm::EDGetTokenT<reco::VertexCollection> StudyHLT::tok_recVtx_
private

Definition at line 128 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

edm::EDGetTokenT<trigger::TriggerEvent> StudyHLT::tok_trigEvt
private

Definition at line 124 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

edm::EDGetTokenT<edm::TriggerResults> StudyHLT::tok_trigRes
private

Definition at line 125 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

double StudyHLT::tr_eventWeight
private

Definition at line 147 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), fillEnergy(), fillIsolation(), and fillTrack().

std::vector<double> StudyHLT::tr_FE11x11P
private

Definition at line 152 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<double> StudyHLT::tr_FE15x15P
private

Definition at line 152 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<double> StudyHLT::tr_FE7x7P
private

Definition at line 152 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

int StudyHLT::tr_goodPV
private

Definition at line 146 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

int StudyHLT::tr_goodRun
private

Definition at line 146 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

std::vector<double> StudyHLT::tr_H3x3
private

Definition at line 151 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<double> StudyHLT::tr_H5x5
private

Definition at line 151 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<double> StudyHLT::tr_H7x7
private

Definition at line 151 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<int> StudyHLT::tr_iEta
private

Definition at line 154 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<double> StudyHLT::tr_MaxNearHcalP7x7
private

Definition at line 150 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<double> StudyHLT::tr_MaxNearP31X31
private

Definition at line 150 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<bool> StudyHLT::tr_SE11x11P
private

Definition at line 153 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<bool> StudyHLT::tr_SE15x15P
private

Definition at line 153 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<bool> StudyHLT::tr_SE7x7P
private

Definition at line 153 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<std::string> StudyHLT::tr_TrigName
private

Definition at line 148 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<double> StudyHLT::tr_TrkEta
private

Definition at line 149 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<int> StudyHLT::tr_TrkID
private

Definition at line 154 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<double> StudyHLT::tr_TrkP
private

Definition at line 149 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<double> StudyHLT::tr_TrkPhi
private

Definition at line 149 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

std::vector<double> StudyHLT::tr_TrkPt
private

Definition at line 149 of file StudyHLT.cc.

Referenced by analyze(), beginJob(), and clear().

TTree* StudyHLT::tree_
private

Definition at line 143 of file StudyHLT.cc.

Referenced by analyze(), and beginJob().

const edm::InputTag StudyHLT::triggerEvent_
private

Definition at line 118 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

const std::vector<std::string> StudyHLT::trigNames_
private

Definition at line 112 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

const int StudyHLT::verbosity_
private

Definition at line 111 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().

const bool StudyHLT::vetoTrigger_
private

Definition at line 116 of file StudyHLT.cc.

Referenced by analyze(), and StudyHLT().