CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
IsoTrackCalibration Class Reference
Inheritance diagram for IsoTrackCalibration:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 IsoTrackCalibration (const edm::ParameterSet &)
 
 ~IsoTrackCalibration ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

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

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
double dR (math::XYZTLorentzVector &, math::XYZTLorentzVector &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 

Private Attributes

double a_charIsoR
 
double a_coneR
 
double a_mipR
 
bool changed
 
double eEcalMax_
 
double eIsolation_
 
edm::Service< TFileServicefs
 
TH1I * h_iEta
 
TH1F * h_jetp
 
TH1F * h_jetpt [4]
 
TH1F * h_Rechit_E
 
TProfile * h_RecHit_iEta
 
TProfile * h_RecHit_num
 
TH1I * h_tketa0 [5]
 
TH1I * h_tketa1 [5]
 
TH1I * h_tketa2 [5]
 
TH1I * h_tketa3 [5]
 
TH1I * h_tketa4 [5]
 
TH1I * h_tketa5 [5]
 
TH1I * h_tketav1 [5][6]
 
TH1I * h_tketav2 [5][6]
 
HLTConfigProvider hltConfig_
 
std::vector< std::string > HLTNames
 
std::string l1Filter
 
std::string l2Filter
 
std::string l3Filter
 
int nAll
 
int nGood
 
int nRun
 
std::vector< double > pbin
 
std::string processName
 
double pTrackMin_
 
bool qcdMC
 
spr::trackSelectionParameters selectionParameters
 
std::vector< unsigned int > * t_DetIds
 
double t_eHcal
 
double t_eMipDR
 
int t_Event
 
double t_EventWeight
 
std::vector< double > * t_HitEnergies
 
double t_hmaxNearP
 
int t_ieta
 
double t_l1eta
 
double t_l1phi
 
double t_l1pt
 
double t_l3eta
 
double t_l3phi
 
double t_l3pt
 
double t_mindR1
 
double t_mindR2
 
double t_npvObserved
 
double t_npvtruth
 
double t_p
 
bool t_qltyFlag
 
bool t_qltyMissFlag
 
bool t_qltyPVFlag
 
int t_Run
 
bool t_selectTk
 
std::vector< bool > * t_trgbits
 
std::string theTrackQuality
 
edm::InputTag theTriggerResultsLabel
 
edm::EDGetTokenT< reco::BeamSpottok_bs_
 
edm::EDGetTokenT
< EcalRecHitCollection
tok_EB_
 
edm::EDGetTokenT
< EcalRecHitCollection
tok_EE_
 
edm::EDGetTokenT
< GenEventInfoProduct
tok_ew_
 
edm::EDGetTokenT
< reco::TrackCollection
tok_genTrack_
 
edm::EDGetTokenT
< HBHERecHitCollection
tok_hbhe_
 
edm::EDGetTokenT
< reco::GenJetCollection
tok_jets_
 
edm::EDGetTokenT< std::vector
< PileupSummaryInfo > > 
tok_pu_
 
edm::EDGetTokenT
< reco::VertexCollection
tok_recVtx_
 
edm::EDGetTokenT
< trigger::TriggerEvent
tok_trigEvt
 
edm::EDGetTokenT
< edm::TriggerResults
tok_trigRes
 
TTree * tree
 
edm::InputTag triggerEvent_
 
std::vector< int > trigKount
 
std::vector< std::string > trigNames
 
std::vector< int > trigPass
 
std::vector< double > vbin
 
int verbosity
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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

Definition at line 73 of file IsoTrackCalibration.cc.

Constructor & Destructor Documentation

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

Definition at line 137 of file IsoTrackCalibration.cc.

References a_charIsoR, a_coneR, a_mipR, gather_cfg::cout, eEcalMax_, eIsolation_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HLT_25ns14e33_v1_cff::InputTag, relval_steps::k, l1Filter, l2Filter, l3Filter, spr::trackSelectionParameters::maxChi2, spr::trackSelectionParameters::maxDpOverP, spr::trackSelectionParameters::maxDxyPV, spr::trackSelectionParameters::maxDzPV, spr::trackSelectionParameters::maxInMiss, spr::trackSelectionParameters::maxOutMiss, spr::trackSelectionParameters::minLayerCrossed, spr::trackSelectionParameters::minOuterHit, spr::trackSelectionParameters::minPt, spr::trackSelectionParameters::minQuality, processName, pTrackMin_, qcdMC, reco::TrackBase::qualityByName(), selectionParameters, AlCaHLTBitMon_QueryRunRegistry::string, theTrackQuality, theTriggerResultsLabel, tok_bs_, tok_EB_, tok_EE_, tok_ew_, tok_genTrack_, tok_hbhe_, tok_jets_, tok_pu_, tok_recVtx_, tok_trigEvt, tok_trigRes, triggerEvent_, trigKount, trigNames, trigPass, and verbosity.

137  :
138  changed(false), nRun(0), nAll(0), nGood(0),
139  t_trgbits(0), t_DetIds(0), t_HitEnergies(0) {
140  //now do whatever initialization is needed
141  verbosity = iConfig.getUntrackedParameter<int>("Verbosity",0);
142  trigNames = iConfig.getUntrackedParameter<std::vector<std::string> >("Triggers");
143  theTrackQuality = iConfig.getUntrackedParameter<std::string>("TrackQuality","highPurity");
144  processName = iConfig.getUntrackedParameter<std::string>("ProcessName","HLT");
145  l1Filter = iConfig.getUntrackedParameter<std::string>("L1Filter", "hltL1sL1SingleJet");
146  l2Filter = iConfig.getUntrackedParameter<std::string>("L2Filter", "L2Filter");
147  l3Filter = iConfig.getUntrackedParameter<std::string>("L3Filter", "Filter");
148  reco::TrackBase::TrackQuality trackQuality_=reco::TrackBase::qualityByName(theTrackQuality);
149  selectionParameters.minPt = iConfig.getUntrackedParameter<double>("MinTrackPt", 10.0);
150  selectionParameters.minQuality = trackQuality_;
151  selectionParameters.maxDxyPV = iConfig.getUntrackedParameter<double>("MaxDxyPV", 0.2);
152  selectionParameters.maxDzPV = iConfig.getUntrackedParameter<double>("MaxDzPV", 5.0);
153  selectionParameters.maxChi2 = iConfig.getUntrackedParameter<double>("MaxChi2", 5.0);
154  selectionParameters.maxDpOverP = iConfig.getUntrackedParameter<double>("MaxDpOverP", 0.1);
155  selectionParameters.minOuterHit = iConfig.getUntrackedParameter<int>("MinOuterHit", 4);
156  selectionParameters.minLayerCrossed = iConfig.getUntrackedParameter<int>("MinLayerCrossed", 8);
157  selectionParameters.maxInMiss = iConfig.getUntrackedParameter<int>("MaxInMiss", 0);
158  selectionParameters.maxOutMiss = iConfig.getUntrackedParameter<int>("MaxOutMiss", 0);
159  a_coneR = iConfig.getUntrackedParameter<double>("ConeRadius",34.98);
160  a_charIsoR = a_coneR + 28.9;
161  a_mipR = iConfig.getUntrackedParameter<double>("ConeRadiusMIP",14.0);
162  pTrackMin_ = iConfig.getUntrackedParameter<double>("MinimumTrackP",20.0);
163  eEcalMax_ = iConfig.getUntrackedParameter<double>("MaximumEcalEnergy",2.0);
164  eIsolation_ = iConfig.getUntrackedParameter<double>("IsolationEnergy",2.0);
165  qcdMC = iConfig.getUntrackedParameter<bool>("IsItQCDMC", true);
166  bool isItAOD = iConfig.getUntrackedParameter<bool>("IsItAOD", false);
167  triggerEvent_ = edm::InputTag("hltTriggerSummaryAOD","",processName);
168  theTriggerResultsLabel = edm::InputTag("TriggerResults","",processName);
169 
170  // define tokens for access
171  tok_trigEvt = consumes<trigger::TriggerEvent>(triggerEvent_);
172  tok_trigRes = consumes<edm::TriggerResults>(theTriggerResultsLabel);
173  tok_genTrack_ = consumes<reco::TrackCollection>(edm::InputTag("generalTracks"));
174  tok_recVtx_ = consumes<reco::VertexCollection>(edm::InputTag("offlinePrimaryVertices"));
175  tok_bs_ = consumes<reco::BeamSpot>(edm::InputTag("offlineBeamSpot"));
176  tok_ew_ = consumes<GenEventInfoProduct>(edm::InputTag("generator"));
177  tok_pu_ = consumes<std::vector<PileupSummaryInfo>>(iConfig.getParameter<edm::InputTag>("PUinfo"));
178 
179  if (isItAOD) {
180  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEB"));
181  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("reducedEcalRecHitsEE"));
182  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("reducedHcalRecHits", "hbhereco"));
183  } else {
184  tok_EB_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEB"));
185  tok_EE_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalRecHit","EcalRecHitsEE"));
186  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag("hbhereco"));
187  }
188  tok_jets_ = consumes<reco::GenJetCollection>(iConfig.getParameter<edm::InputTag>("JetSource"));
189 
190  std::vector<int>dummy(trigNames.size(),0);
191  trigKount = trigPass = dummy;
192 #ifdef DebugLog
193  if (verbosity>=0) {
194  std::cout <<"Parameters read from config file \n"
195  <<"\t minPt " << selectionParameters.minPt
196  <<"\t theTrackQuality " << theTrackQuality
197  <<"\t minQuality " << selectionParameters.minQuality
198  <<"\t maxDxyPV " << selectionParameters.maxDxyPV
199  <<"\t maxDzPV " << selectionParameters.maxDzPV
200  <<"\t maxChi2 " << selectionParameters.maxChi2
201  <<"\t maxDpOverP " << selectionParameters.maxDpOverP
202  <<"\t minOuterHit " << selectionParameters.minOuterHit
203  <<"\t minLayerCrossed " << selectionParameters.minLayerCrossed
204  <<"\t maxInMiss " << selectionParameters.maxInMiss
205  <<"\t maxOutMiss " << selectionParameters.maxOutMiss
206  <<"\t a_coneR " << a_coneR
207  <<"\t a_charIsoR " << a_charIsoR
208  <<"\t a_mipR " << a_mipR
209  <<"\t qcdMC " << qcdMC
210  << std::endl;
211  std::cout << "Process " << processName << " L1Filter:" << l1Filter
212  << " L2Filter:" << l2Filter << " L3Filter:" << l3Filter
213  << std::endl;
214  std::cout << trigNames.size() << " triggers to be studied";
215  for (unsigned int k=0; k<trigNames.size(); ++k)
216  std::cout << ": " << trigNames[k];
217  std::cout << std::endl;
218  }
219 #endif
220 }
std::vector< int > trigPass
std::vector< bool > * t_trgbits
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
TrackQuality
track quality
Definition: TrackBase.h:139
std::vector< int > trigKount
std::vector< std::string > trigNames
edm::InputTag theTriggerResultsLabel
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
std::vector< double > * t_HitEnergies
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:114
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > tok_pu_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
spr::trackSelectionParameters selectionParameters
reco::TrackBase::TrackQuality minQuality
edm::EDGetTokenT< reco::GenJetCollection > tok_jets_
tuple cout
Definition: gather_cfg.py:121
std::vector< unsigned int > * t_DetIds
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
IsoTrackCalibration::~IsoTrackCalibration ( )

Definition at line 222 of file IsoTrackCalibration.cc.

References t_DetIds, t_HitEnergies, and t_trgbits.

222  {
223  // do anything here that needs to be done at desctruction time
224  // (e.g. close files, deallocate resources etc.)
225  if (t_trgbits) delete t_trgbits;
226  if (t_DetIds) delete t_DetIds;
227  if (t_HitEnergies) delete t_HitEnergies;
228 
229 }
std::vector< bool > * t_trgbits
std::vector< double > * t_HitEnergies
std::vector< unsigned int > * t_DetIds

Member Function Documentation

void IsoTrackCalibration::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 231 of file IsoTrackCalibration.cc.

References a_charIsoR, a_coneR, a_mipR, ecalTB2006H4_GenSimDigiReco_cfg::bField, edm::EventBase::bunchCrossing(), rpcdqm::BX, changed, spr::chargeIsolationCone(), gather_cfg::cout, dR(), spr::eCone_ecal(), spr::eCone_hcal(), eEcalMax_, eIsolation_, trigger::TriggerObject::energy(), trigger::TriggerObject::eta(), reco::LeafCandidate::eta(), reco::TrackBase::eta(), edm::EventID::event(), trigger::TriggerEvent::filterKeys(), trigger::TriggerEvent::filterTag(), spr::find(), edm::EventSetup::get(), edm::Event::getByToken(), trigger::TriggerEvent::getObjects(), spr::goodTrack(), h_iEta, h_jetpt, h_Rechit_E, h_RecHit_iEta, h_RecHit_num, h_tketa0, h_tketa1, h_tketa2, h_tketa3, h_tketa4, h_tketa5, h_tketav1, h_tketav2, runregparse::hlt, hltConfig_, i, trigger::TriggerObject::id(), edm::EventBase::id(), HcalDetId::ieta(), edm::HandleBase::isValid(), relval_steps::k, l1Filter, l2Filter, l3Filter, diffTwoXMLs::label, edm::InputTag::label(), edm::EventBase::luminosityBlock(), trigger::TriggerObject::mass(), spr::trackSelectionParameters::maxDxyPV, spr::trackSelectionParameters::maxDzPV, spr::trackSelectionParameters::maxInMiss, spr::trackSelectionParameters::maxOutMiss, HLTConfigProvider::moduleLabels(), edmConvertToStreamModule::modules, gen::n, nAll, nGood, convertSQLiteXML::ok, reco::TrackBase::p(), pbin, trigger::TriggerObject::phi(), reco::TrackBase::phi(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), spr::propagateCALO(), trigger::TriggerObject::pt(), reco::LeafCandidate::pt(), reco::TrackBase::pt(), pTrackMin_, trigger::TriggerObject::px(), reco::TrackBase::px(), trigger::TriggerObject::py(), reco::TrackBase::py(), trigger::TriggerObject::pz(), reco::TrackBase::pz(), qcdMC, edm::EventID::run(), selectionParameters, HLTConfigProvider::size(), findQualityFiles::size, trigger::TriggerEvent::sizeFilters(), AlCaHLTBitMon_QueryRunRegistry::string, t_DetIds, t_eHcal, t_eMipDR, t_Event, t_EventWeight, t_HitEnergies, t_hmaxNearP, t_ieta, t_l1eta, t_l1phi, t_l1pt, t_l3eta, t_l3phi, t_l3pt, t_mindR1, t_mindR2, t_npvObserved, t_npvtruth, t_p, t_qltyFlag, t_qltyMissFlag, t_qltyPVFlag, t_Run, t_selectTk, t_trgbits, theTrackQuality, tok_bs_, tok_EB_, tok_EE_, tok_ew_, tok_genTrack_, tok_hbhe_, tok_jets_, tok_pu_, tok_recVtx_, tok_trigEvt, tok_trigRes, tree, triggerEvent_, HLTConfigProvider::triggerIndex(), edm::TriggerNames::triggerNames(), edm::Event::triggerNames(), triggerResults, trigKount, trigNames, trigPass, vbin, verbosity, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

232  {
233 
234  t_Run = iEvent.id().run();
235  t_Event = iEvent.id().event();
236  nAll++;
237 #ifdef DebugLog
238  if (verbosity%10 > 0)
239  std::cout << "Run " << t_Run << " Event " << t_Event << " Luminosity "
240  << iEvent.luminosityBlock() << " Bunch " << iEvent.bunchCrossing()
241  << " starts ==========" << std::endl;
242 #endif
243  //Get magnetic field and ECAL channel status
245  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
246  const MagneticField *bField = bFieldH.product();
247 
249  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
250 
251  // get handles to calogeometry and calotopology
253  iSetup.get<CaloGeometryRecord>().get(pG);
254  const CaloGeometry* geo = pG.product();
255 
256  //Get track collection
258  iEvent.getByToken(tok_genTrack_, trkCollection);
259  reco::TrackCollection::const_iterator trkItr;
260 
261  //event weight for FLAT sample and PU information
262  t_EventWeight = 1.0;
264  iEvent.getByToken(tok_ew_, genEventInfo);
265  if (genEventInfo.isValid()) t_EventWeight = genEventInfo->weight();
266  t_npvtruth = t_npvObserved = 999;
268  iEvent.getByToken(tok_pu_, PupInfo);
269  if (PupInfo.isValid()) {
270  std::vector<PileupSummaryInfo>::const_iterator PVI;
271  for (PVI = PupInfo->begin(); PVI != PupInfo->end(); ++PVI) {
272  int BX = PVI->getBunchCrossing();
273  if (BX==0) {
274  t_npvtruth = PVI->getTrueNumInteractions();
275  t_npvObserved = PVI->getPU_NumInteractions();
276  break;
277  }
278  }
279  }
280  int ivtx = (int)(vbin.size()-2);
281  for (unsigned int iv=1; iv<vbin.size(); ++iv) {
282 #ifdef DebugLog
283  std::cout << "Bin " << iv << " " << vbin[iv-1] << ":" << vbin[iv] << std::endl;
284 #endif
285  if (t_npvtruth <= vbin[iv]) {
286  ivtx = iv-1; break;
287  }
288  }
289 #ifdef DebugLog
290  if (verbosity == 0)
291  std::cout << "PU Vertex " << t_npvtruth << "/" << t_npvObserved << " IV "
292  << ivtx << ":" << vbin.size() << std::endl;
293 #endif
294  //=== genJet information
296  iEvent.getByToken(tok_jets_, genJets);
297  if (genJets.isValid()) {
298  for (unsigned iGenJet = 0; iGenJet < genJets->size(); ++iGenJet) {
299  const reco::GenJet& genJet = (*genJets) [iGenJet];
300  double genJetPt = genJet.pt();
301  double genJetEta = genJet.eta();
302  h_jetpt[0]->Fill(genJetPt);
303  h_jetpt[1]->Fill(genJetPt,t_EventWeight);
304  if (genJetEta>-2.5 && genJetEta<2.5) {
305  h_jetpt[2]->Fill(genJetPt);
306  h_jetpt[3]->Fill(genJetPt,t_EventWeight);
307  }
308  }
309  }
310 
311  //Define the best vertex and the beamspot
313  iEvent.getByToken(tok_recVtx_, recVtxs);
314  edm::Handle<reco::BeamSpot> beamSpotH;
315  iEvent.getByToken(tok_bs_, beamSpotH);
316  math::XYZPoint leadPV(0,0,0);
317  if (recVtxs->size()>0 && !((*recVtxs)[0].isFake())) {
318  leadPV = math::XYZPoint( (*recVtxs)[0].x(),(*recVtxs)[0].y(), (*recVtxs)[0].z() );
319  } else if (beamSpotH.isValid()) {
320  leadPV = beamSpotH->position();
321  }
322 #ifdef DebugLog
323  if ((verbosity/100)%10>0) {
324  std::cout << "Primary Vertex " << leadPV;
325  if (beamSpotH.isValid()) std::cout << " Beam Spot "
326  << beamSpotH->position();
327  std::cout << std::endl;
328  }
329 #endif
330  // RecHits
331  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
332  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
333  iEvent.getByToken(tok_EB_, barrelRecHitsHandle);
334  iEvent.getByToken(tok_EE_, endcapRecHitsHandle);
336  iEvent.getByToken(tok_hbhe_, hbhe);
338 
339  for (rhitItr=hbhe->begin();rhitItr!=hbhe->end();rhitItr++) {
340  double rec_energy = rhitItr->energy();
341  int rec_ieta = rhitItr->id().ieta();
342  int rec_depth = rhitItr->id().depth();
343  int rec_zside = rhitItr->id().zside();
344  double num1_1 = rec_zside*(rec_ieta+0.2*(rec_depth-1));
345 #ifdef DebugLog
346  if (verbosity%10>0)
347  std::cout << "detid/rechit/ieta/zside/depth/num = " << rhitItr->id()
348  << "/" << rec_energy << "/" << rec_ieta << "/" << rec_zside
349  << "/" << rec_depth << "/" << num1_1 << std::endl;
350 #endif
351  h_iEta->Fill(rec_ieta);
352  h_Rechit_E->Fill(rec_energy);
353  h_RecHit_iEta->Fill(rec_ieta,rec_energy);
354  h_RecHit_num->Fill(num1_1,rec_energy);
355  }
356 
357  //Propagate tracks to calorimeter surface)
358  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
359  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality,
360  trkCaloDirections, ((verbosity/100)%10>2));
361  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
362  for (trkDetItr = trkCaloDirections.begin();
363  trkDetItr != trkCaloDirections.end(); trkDetItr++) {
364  if (trkDetItr->okHCAL) {
365  HcalDetId detId = (HcalDetId)(trkDetItr->detIdHCAL);
366  int tk_ieta = detId.ieta();
367  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
368  double tk_p = pTrack->p();
369  h_tketa0[0]->Fill(tk_ieta);
370  h_tketav1[ivtx][0]->Fill(tk_ieta);
371 #ifdef DebugLog
372  std::cout << "Fill for " << tk_ieta << " in " << ivtx << ":"
373  << h_tketav1[ivtx][0]->GetName() << std::endl;
374 #endif
375  for (unsigned int k=1; k<pbin.size(); ++k) {
376  if (tk_p >= pbin[k-1] && tk_p < pbin[k]) {
377  h_tketa0[k]->Fill(tk_ieta);
378  h_tketav1[ivtx][k]->Fill(tk_ieta);
379 #ifdef DebugLog
380  std::cout << "Fill for " << tk_ieta << ":" << tk_p << " in " << ivtx
381  << ":" << h_tketav1[ivtx][k]->GetName() << std::endl;
382 #endif
383  break;
384  }
385  }
386  }
387  }
388 
389  //Trigger
390  t_trgbits->clear();
391  for (unsigned int i=0; i<trigNames.size(); ++i) t_trgbits->push_back(false);
392 
393  trigger::TriggerEvent triggerEvent;
394  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
395  iEvent.getByToken(tok_trigEvt, triggerEventHandle);
396  if (!triggerEventHandle.isValid()) {
397 #ifdef DebugLog
398  std::cout << "Error! Can't get the product "<< triggerEvent_.label()
399  << std::endl;
400 #endif
401  } else {
402  triggerEvent = *(triggerEventHandle.product());
403 
404  const trigger::TriggerObjectCollection& TOC(triggerEvent.getObjects());
407  iEvent.getByToken(tok_trigRes, triggerResults);
408  if (triggerResults.isValid()) {
409  std::vector<std::string> modules;
410  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
411  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
412  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
413  bool ok(false);
414  int hlt = triggerResults->accept(iHLT);
415  for (unsigned int i=0; i<trigNames.size(); ++i) {
416  if (triggerNames_[iHLT].find(trigNames[i].c_str())!=std::string::npos) {
417  t_trgbits->at(i) = (hlt>0);
418  trigKount[i]++;
419  if (hlt > 0) {
420  ok = true;
421  trigPass[i]++;
422  }
423 #ifdef DebugLog
424  if (verbosity%10 > 0)
425  std::cout << "This is the trigger we are looking for "
426  << triggerNames_[iHLT] << " Flag " << hlt << ":"
427  << ok << std::endl;
428 #endif
429  }
430  }
431 
432  if (ok) {
433  unsigned int triggerindx = hltConfig_.triggerIndex(triggerNames_[iHLT]);
434  const std::vector<std::string>& moduleLabels(hltConfig_.moduleLabels(triggerindx));
435  std::vector<math::XYZTLorentzVector> vec[3];
436  //loop over all trigger filters in event (i.e. filters passed)
437  for (unsigned int ifilter=0; ifilter<triggerEvent.sizeFilters();
438  ++ifilter) {
439  std::vector<int> Keys;
440  std::string label = triggerEvent.filterTag(ifilter).label();
441  //loop over keys to objects passing this filter
442  for (unsigned int imodule=0; imodule<moduleLabels.size();
443  imodule++) {
444  if (label.find(moduleLabels[imodule]) != std::string::npos) {
445 #ifdef DebugLog
446  if (verbosity%10 > 0) std::cout << "FilterName " << label << std::endl;
447 #endif
448  for (unsigned int ifiltrKey=0; ifiltrKey<triggerEvent.filterKeys(ifilter).size(); ++ifiltrKey) {
449  Keys.push_back(triggerEvent.filterKeys(ifilter)[ifiltrKey]);
450  const trigger::TriggerObject& TO(TOC[Keys[ifiltrKey]]);
451  math::XYZTLorentzVector v4(TO.px(), TO.py(), TO.pz(), TO.energy());
452  if (qcdMC) {
453  if (label.find("hltL1s") != std::string::npos) {
454  vec[0].push_back(v4);
455  } else if (label.find("PFJet") != std::string::npos) {
456  vec[2].push_back(v4);
457  } else {
458  vec[1].push_back(v4);
459  }
460  } else {
461  if (label.find(l2Filter) != std::string::npos) {
462  vec[1].push_back(v4);
463  } else if (label.find(l3Filter) != std::string::npos) {
464  vec[2].push_back(v4);
465  } else if (label.find(l1Filter) != std::string::npos ||
466  l1Filter == "") {
467  vec[0].push_back(v4);
468  }
469  }
470 #ifdef DebugLog
471  if (verbosity%10 > 2)
472  std::cout << "key " << ifiltrKey << " : pt " << TO.pt()
473  << " eta " << TO.eta() << " phi " << TO.phi()
474  << " mass " << TO.mass() << " Id " << TO.id()
475  << std::endl;
476 #endif
477  }
478 #ifdef DebugLog
479  if (verbosity%10 > 0) std::cout << "sizes " << vec[0].size()
480  << ":" << vec[1].size() << ":"
481  << vec[2].size() << std::endl;
482 #endif
483  }
484  }
485  }
486  double dr;
488  math::XYZTLorentzVector mindRvec1;
489  double mindR1(999);
490  for (int lvl=1; lvl<3; lvl++) {
491  for (unsigned int i=0; i<vec[lvl].size(); i++) {
492  dr = dR(vec[0][0],vec[lvl][i]);
493 #ifdef DebugLog
494  if (verbosity%10 > 2) std::cout << "lvl " <<lvl << " i " << i
495  << " dR " << dr << std::endl;
496 #endif
497  if (dr<mindR1) {
498  mindR1 = dr;
499  mindRvec1 = vec[lvl][i];
500  }
501  }
502  }
503 
504  t_l1pt = vec[0][0].pt();
505  t_l1eta = vec[0][0].eta();
506  t_l1phi = vec[0][0].phi();
507  if (vec[2].size()>0) {
508  t_l3pt = vec[2][0].pt();
509  t_l3eta = vec[2][0].eta();
510  t_l3phi = vec[2][0].phi();
511  }
512  //Loop over tracks
513  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
514  unsigned int nTracks(0), nselTracks(0);
515  for (trkDetItr = trkCaloDirections.begin(),nTracks=0;
516  trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++) {
517  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
518  math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(),
519  pTrack->pz(), pTrack->p());
520 #ifdef DebugLog
521  if (verbosity%10> 0)
522  std::cout << "This track : " << nTracks << " (pt/eta/phi/p) :"
523  << pTrack->pt() << "/" << pTrack->eta() << "/"
524  << pTrack->phi() << "/" << pTrack->p() << std::endl;
525 #endif
526  math::XYZTLorentzVector mindRvec2;
527  t_mindR2 = 999;
528 
529  for (unsigned int k=0; k<vec[2].size(); ++k) {
530  dr = dR(vec[2][k],v4); //changed 1 to 2
531  if (dr<t_mindR2) {
532  t_mindR2 = dr;
533  mindRvec2 = vec[2][k];
534  }
535  }
536  t_mindR1 = dR(vec[0][0],v4);
537 #ifdef DebugLog
538  if (verbosity%10> 2)
539  std::cout << "Closest L3 object at mindr :" << t_mindR2 << " is "
540  << mindRvec2 << " and from L1 " << t_mindR1 <<std::endl;
541 #endif
542 
543  //Selection of good track
544  t_selectTk = spr::goodTrack(pTrack,leadPV,selectionParameters,((verbosity/100)%10>2));
546  oneCutParameters.maxDxyPV = 10;
547  oneCutParameters.maxDzPV = 100;
548  oneCutParameters.maxInMiss = 2;
549  oneCutParameters.maxOutMiss= 2;
550  bool qltyFlag = spr::goodTrack(pTrack,leadPV,oneCutParameters,((verbosity/100)%10>2));
551  oneCutParameters = selectionParameters;
552  oneCutParameters.maxDxyPV = 10;
553  oneCutParameters.maxDzPV = 100;
554  t_qltyMissFlag = spr::goodTrack(pTrack,leadPV,oneCutParameters,((verbosity/100)%10>2));
555  oneCutParameters = selectionParameters;
556  oneCutParameters.maxInMiss = 2;
557  oneCutParameters.maxOutMiss= 2;
558  t_qltyPVFlag = spr::goodTrack(pTrack,leadPV,oneCutParameters,((verbosity/100)%10>2));
559  t_ieta = 0;
560  if (trkDetItr->okHCAL) {
561  HcalDetId detId = (HcalDetId)(trkDetItr->detIdHCAL);
562  t_ieta = detId.ieta();
563  }
564 #ifdef DebugLog
565  if (verbosity%10 > 0)
566  std::cout << "qltyFlag|okECAL|okHCAL : " << qltyFlag << "|"
567  << trkDetItr->okECAL << "/" << trkDetItr->okHCAL
568  << std::endl;
569 #endif
570  t_qltyFlag = (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL);
571  t_p = pTrack->p();
572  h_tketa1[0]->Fill(t_ieta);
573  for (unsigned int k=1; k<pbin.size(); ++k) {
574  if (t_p >= pbin[k-1] && t_p < pbin[k]) {
575  h_tketa1[k]->Fill(t_ieta);
576  break;
577  }
578  }
579  if (t_qltyFlag) {
580  nselTracks++;
581  h_tketa2[0]->Fill(t_ieta);
582  for (unsigned int k=1; k<pbin.size(); ++k) {
583  if (t_p >= pbin[k-1] && t_p < pbin[k]) {
584  h_tketa2[k]->Fill(t_ieta);
585  break;
586  }
587  }
588  int nRH_eMipDR(0), nNearTRKs(0), nRecHits(-999);
589  t_eMipDR = spr::eCone_ecal(geo, barrelRecHitsHandle,
590  endcapRecHitsHandle,
591  trkDetItr->pointHCAL,
592  trkDetItr->pointECAL,
593  a_mipR, trkDetItr->directionECAL,
594  nRH_eMipDR);
595  t_DetIds->clear(); t_HitEnergies->clear();
596  std::vector<DetId> ids;
597  t_eHcal = spr::eCone_hcal(geo, hbhe, trkDetItr->pointHCAL,
598  trkDetItr->pointECAL, a_coneR,
599  trkDetItr->directionHCAL,nRecHits,
600  ids, *t_HitEnergies);
601  for (unsigned int k=0; k<ids.size(); ++k) {
602  t_DetIds->push_back(ids[k].rawId());
603  }
604  t_hmaxNearP = spr::chargeIsolationCone(nTracks,trkCaloDirections,
605  a_charIsoR, nNearTRKs,
606  ((verbosity/100)%10>2));
607  if (t_hmaxNearP < 2) {
608  h_tketa3[0]->Fill(t_ieta);
609  for (unsigned int k=1; k<pbin.size(); ++k) {
610  if (t_p >= pbin[k-1] && t_p < pbin[k]) {
611  h_tketa3[k]->Fill(t_ieta);
612  break;
613  }
614  }
615  if (t_eMipDR < 1) {
616  h_tketa4[0]->Fill(t_ieta);
617  for (unsigned int k=1; k<pbin.size(); ++k) {
618  if (t_p >= pbin[k-1] && t_p < pbin[k]) {
619  h_tketa4[k]->Fill(t_ieta);
620  break;
621  }
622  }
623  if (t_mindR1 > 1) {
624  h_tketa5[0]->Fill(t_ieta);
625  h_tketav2[ivtx][0]->Fill(t_ieta);
626  for (unsigned int k=1; k<pbin.size(); ++k) {
627  if (t_p >= pbin[k-1] && t_p < pbin[k]) {
628  h_tketa5[k]->Fill(t_ieta);
629  h_tketav2[ivtx][k]->Fill(t_ieta);
630  break;
631  }
632  }
633  }
634  }
635  }
636 #ifdef DebugLog
637  if (verbosity%10 > 0) {
638  std::cout << "This track : " << nTracks << " (pt/eta/phi/p) :"
639  << pTrack->pt() << "/" << pTrack->eta() << "/"
640  << pTrack->phi() << "/" << t_p << std::endl;
641  std::cout << "e_MIP " << t_eMipDR << " Chg Isolation "
642  << t_hmaxNearP << " eHcal" << t_eHcal << " ieta "
643  << t_ieta << " Quality " << t_qltyMissFlag
644  << ":" << t_qltyPVFlag << ":" << t_selectTk
645  << std::endl;
646  for (unsigned int lll=0;lll<t_DetIds->size();lll++) {
647  std::cout << "det id is = " << t_DetIds->at(lll) << " "
648  << " hit enery is = " << t_HitEnergies->at(lll)
649  << std::endl;
650  }
651  }
652 #endif
653  if (t_p>pTrackMin_ && t_eMipDR<eEcalMax_ &&
655 #ifdef DebugLog
656  if (verbosity%10> 2) {
657  for (unsigned int k=0; k<t_trgbits->size(); k++)
658  std::cout <<"trigger bit is = " << t_trgbits->at(k)
659  << std::endl;
660  }
661 #endif
662  tree->Fill();
663  nGood++;
664  }
665  }
666  }
667  }
668  }
669  t_trgbits->clear(); t_DetIds->clear(); t_HitEnergies->clear();
670  // check if trigger names in (new) config
671  if (changed) {
672  changed = false;
673 #ifdef DebugLog
674  if (verbosity%10> 1) {
675  std::cout<<"New trigger menu found !!!" << std::endl;
676  const unsigned int n(hltConfig_.size());
677  for (unsigned itrig=0; itrig<triggerNames_.size(); itrig++) {
678  unsigned int triggerindx = hltConfig_.triggerIndex(triggerNames_[itrig]);
679  std::cout << triggerNames_[itrig] << " " << triggerindx << " ";
680  if (triggerindx >= n)
681  std::cout << "does not exist in the current menu" << std::endl;
682  else
683  std::cout << "exists" << std::endl;
684  }
685  }
686 #endif
687  }
688  }
689  }
690 }
RunNumber_t run() const
Definition: EventID.h:39
std::vector< int > trigPass
unsigned int size() const
number of trigger paths in trigger table
double p() const
momentum vector magnitude
Definition: TrackBase.h:568
std::vector< bool > * t_trgbits
EventNumber_t event() const
Definition: EventID.h:41
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:208
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:135
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
std::vector< HBHERecHit >::const_iterator const_iterator
int bunchCrossing() const
Definition: EventBase.h:66
std::vector< int > trigKount
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
std::vector< std::string > trigNames
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:598
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:580
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
Strings const & triggerNames() const
Definition: TriggerNames.cc:24
std::vector< double > vbin
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
float float float z
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:22
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:604
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
double pt() const
track transverse momentum
Definition: TrackBase.h:574
int ieta() const
get the cell ieta
Definition: HcalDetId.h:36
Jets made from MC generator particles.
Definition: GenJet.h:24
double eCone_ecal(const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
static std::string const triggerResults
Definition: EdmProvDump.cc:40
bool isValid() const
Definition: HandleBase.h:75
std::vector< double > * t_HitEnergies
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:592
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
const edm::InputTag filterTag(trigger::size_type index) const
Definition: TriggerEvent.h:103
T const * product() const
Definition: Handle.h:81
double eCone_hcal(const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, bool debug=false)
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > tok_pu_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::vector< size_type > Keys
double dR(math::XYZTLorentzVector &, math::XYZTLorentzVector &)
const T & get() const
Definition: EventSetup.h:55
std::vector< double > pbin
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
std::string const & label() const
Definition: InputTag.h:42
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt
edm::EventID id() const
Definition: EventBase.h:60
spr::trackSelectionParameters selectionParameters
edm::EDGetTokenT< reco::GenJetCollection > tok_jets_
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
std::vector< unsigned int > * t_DetIds
HLTConfigProvider hltConfig_
tuple size
Write out results.
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:586
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
void IsoTrackCalibration::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 692 of file IsoTrackCalibration.cc.

References fs, h_iEta, h_jetpt, h_Rechit_E, h_RecHit_iEta, h_RecHit_num, h_tketa0, h_tketa1, h_tketa2, h_tketa3, h_tketa4, h_tketa5, h_tketav1, h_tketav2, relval_steps::k, prof2calltree::l, TFileService::make(), mergeVDriftHistosByStation::name, pbin, AlCaHLTBitMon_QueryRunRegistry::string, t_DetIds, t_eHcal, t_eMipDR, t_Event, t_EventWeight, t_HitEnergies, t_hmaxNearP, t_ieta, t_l1eta, t_l1phi, t_l1pt, t_l3eta, t_l3phi, t_l3pt, t_mindR1, t_mindR2, t_npvObserved, t_npvtruth, t_p, t_qltyFlag, t_qltyMissFlag, t_qltyPVFlag, t_Run, t_selectTk, t_trgbits, indexGen::title, tree, and vbin.

692  {
693  h_RecHit_iEta = fs->make<TProfile>("rechit_ieta","Rec hit vs. ieta",60,-30,30,0,1000);
694  h_RecHit_num = fs->make<TProfile>("rechit_num","Rec hit vs. num",100,0,20,0,1000);
695  h_iEta = fs->make<TH1I>("iEta","iEta",60,-30,30);
696  h_Rechit_E = fs->make<TH1F>("Rechit_E","Rechit_E",100,0,1000);
697 
698  double prange[5] = {20,30,40,60,100};
699  for (int k=0; k<5; ++k) pbin.push_back(prange[k]);
700  std::string type[6] = {"All", "Trigger OK", "Tree Selected",
701  "Charge Isolation", "MIP Cut", "L1 Cut"};
702  double vrange[6] = {0, 10, 20, 30, 40, 1000};
703  for (int k=0; k<6; ++k) vbin.push_back(vrange[k]);
704  char name[20], namp[20], title[100];
705  for (unsigned int k=0; k<pbin.size(); ++k) {
706  if (k == 0) sprintf (namp, "all momentum");
707  else sprintf (namp, "p = %4.0f:%4.0f GeV", pbin[k-1], pbin[k]);
708  sprintf (name, "TrackEta0%d", k);
709  sprintf (title, "Track #eta for tracks with %s (%s)",namp,type[0].c_str());
710  h_tketa0[k] = fs->make<TH1I>(name, title, 60, -30, 30);
711  sprintf (name, "TrackEta1%d", k);
712  sprintf (title, "Track #eta for tracks with %s (%s)",namp,type[1].c_str());
713  h_tketa1[k] = fs->make<TH1I>(name, title, 60, -30, 30);
714  sprintf (name, "TrackEta2%d", k);
715  sprintf (title, "Track #eta for tracks with %s (%s)",namp,type[2].c_str());
716  h_tketa2[k] = fs->make<TH1I>(name, title, 60, -30, 30);
717  sprintf (name, "TrackEta3%d", k);
718  sprintf (title, "Track #eta for tracks with %s (%s)",namp,type[3].c_str());
719  h_tketa3[k] = fs->make<TH1I>(name, title, 60, -30, 30);
720  sprintf (name, "TrackEta4%d", k);
721  sprintf (title, "Track #eta for tracks with %s (%s)",namp,type[4].c_str());
722  h_tketa4[k] = fs->make<TH1I>(name, title, 60, -30, 30);
723  sprintf (name, "TrackEta5%d", k);
724  sprintf (title, "Track #eta for tracks with %s (%s)",namp,type[5].c_str());
725  h_tketa5[k] = fs->make<TH1I>(name, title, 60, -30, 30);
726  for (unsigned int l=0; l<vbin.size()-1; ++l) {
727  int v1 = (int)(vbin[l]);
728  int v2 = (int)(vbin[l+1]);
729  sprintf (name, "TrackEta1%dVtx%d", k, l);
730  sprintf (title, "Track #eta for tracks with %s (%s and PU %d:%d)",namp,type[0].c_str(),v1,v2);
731  h_tketav1[l][k] = fs->make<TH1I>(name, title, 60, -30, 30);
732  sprintf (name, "TrackEta2%dVtx%d", k, l);
733  sprintf (title, "Track #eta for tracks with %s (%s and PU %d:%d)",namp,type[5].c_str(),v1,v2);
734  h_tketav2[l][k] = fs->make<TH1I>(name, title, 60, -30, 30);
735  }
736  }
737  h_jetpt[0] = fs->make<TH1F>("Jetpt0","Jet p_T (All)", 500,0.,2500.);
738  h_jetpt[1] = fs->make<TH1F>("Jetpt1","Jet p_T (All Weighted)", 500,0.,2500.);
739  h_jetpt[2] = fs->make<TH1F>("Jetpt2","Jet p_T (|#eta| < 2.5)", 500,0.,2500.);
740  h_jetpt[3] = fs->make<TH1F>("Jetpt3","Jet p_T (|#eta| < 2.5 Weighted)", 500,0.,2500.);
741  tree = fs->make<TTree>("CalibTree", "CalibTree");
742 
743 
744  tree->Branch("t_Run", &t_Run, "t_Run/I");
745  tree->Branch("t_Event", &t_Event, "t_Event/I");
746  tree->Branch("t_ieta", &t_ieta, "t_ieta/I");
747  tree->Branch("t_EventWeight", &t_EventWeight, "t_EventWeight/D");
748  tree->Branch("t_npvtruth", &t_npvtruth, "t_npvtruth/D");
749  tree->Branch("t_npvObserved", &t_npvObserved, "t_npvObserved/D");
750  tree->Branch("t_l1pt", &t_l1pt, "t_l1pt/D");
751  tree->Branch("t_l1eta", &t_l1eta, "t_l1eta/D");
752  tree->Branch("t_l1phi", &t_l1phi, "t_l1phi/D");
753  tree->Branch("t_l3pt", &t_l3pt, "t_l3pt/D");
754  tree->Branch("t_l3eta", &t_l3eta, "t_l3eta/D");
755  tree->Branch("t_l3phi", &t_l3phi, "t_l3phi/D");
756  tree->Branch("t_p", &t_p, "t_p/D");
757  tree->Branch("t_mindR1", &t_mindR1, "t_mindR1/D");
758  tree->Branch("t_mindR2", &t_mindR2, "t_mindR2/D");
759  tree->Branch("t_eMipDR", &t_eMipDR, "t_eMipDR/D");
760  tree->Branch("t_eHcal", &t_eHcal, "t_eHcal/D");
761  tree->Branch("t_hmaxNearP", &t_hmaxNearP, "t_hmaxNearP/D");
762  tree->Branch("t_selectTk", &t_selectTk, "t_selectTk/O");
763  tree->Branch("t_qltyFlag", &t_qltyFlag, "t_qltyFlag/O");
764  tree->Branch("t_qltyMissFlag",&t_qltyMissFlag,"t_qltyMissFlag/O");
765  tree->Branch("t_qltyPVFlag", &t_qltyPVFlag, "t_qltyPVFlag/O)");
766 
767  t_DetIds = new std::vector<unsigned int>();
768  t_HitEnergies = new std::vector<double>();
769  t_trgbits = new std::vector<bool>();
770  tree->Branch("t_DetIds", "std::vector<unsigned int>", &t_DetIds);
771  tree->Branch("t_HitEnergies", "std::vector<double>", &t_HitEnergies);
772  tree->Branch("t_trgbits", "std::vector<bool>", &t_trgbits);
773 }
type
Definition: HCALResponse.h:21
std::vector< bool > * t_trgbits
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
std::vector< double > vbin
edm::Service< TFileService > fs
std::vector< double > * t_HitEnergies
std::vector< double > pbin
std::vector< unsigned int > * t_DetIds
void IsoTrackCalibration::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 798 of file IsoTrackCalibration.cc.

798 {}
void IsoTrackCalibration::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 786 of file IsoTrackCalibration.cc.

References changed, hltConfig_, HLTConfigProvider::init(), nRun, processName, and edm::RunBase::run().

786  {
787  edm::LogWarning("IsoTrack") << "Run[" << nRun <<"] " << iRun.run()
788  << " hltconfig.init " << hltConfig_.init(iRun,iSetup,processName,changed);
789 }
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
HLTConfigProvider hltConfig_
double IsoTrackCalibration::dR ( math::XYZTLorentzVector vec1,
math::XYZTLorentzVector vec2 
)
private

Definition at line 810 of file IsoTrackCalibration.cc.

References reco::deltaR().

Referenced by analyze().

810  {
811  return reco::deltaR(vec1.eta(),vec1.phi(),vec2.eta(),vec2.phi());
812 }
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
std::vector< double > vec1
Definition: HCALResponse.h:15
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
void IsoTrackCalibration::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 776 of file IsoTrackCalibration.cc.

References relval_steps::k, nAll, nGood, nRun, trigKount, trigNames, and trigPass.

776  {
777  edm::LogWarning("IsoTrack") << "Finds " << nGood << " good tracks in "
778  << nAll << " events from " << nRun << " runs";
779  for (unsigned int k=0; k<trigNames.size(); ++k)
780  edm::LogWarning("IsoTrack") << "Trigger[" << k << "]: " << trigNames[k]
781  << " Events " << trigKount[k] << " Passed "
782  << trigPass[k];
783 }
std::vector< int > trigPass
std::vector< int > trigKount
std::vector< std::string > trigNames
void IsoTrackCalibration::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 800 of file IsoTrackCalibration.cc.

800 {}
void IsoTrackCalibration::endRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 792 of file IsoTrackCalibration.cc.

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

792  {
793  nRun++;
794  edm::LogWarning("IsoTrack") << "endRun[" << nRun << "] " << iRun.run();
795 }
void IsoTrackCalibration::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 802 of file IsoTrackCalibration.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

802  {
803  //The following says we do not know what parameters are allowed so do no validation
804  // Please change this to state exactly what you do use, even if it is no parameters
806  desc.setUnknown();
807  descriptions.addDefault(desc);
808 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

double IsoTrackCalibration::a_charIsoR
private

Definition at line 101 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

double IsoTrackCalibration::a_coneR
private

Definition at line 101 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

double IsoTrackCalibration::a_mipR
private

Definition at line 101 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

bool IsoTrackCalibration::changed
private

Definition at line 92 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginRun().

double IsoTrackCalibration::eEcalMax_
private

Definition at line 102 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

double IsoTrackCalibration::eIsolation_
private

Definition at line 102 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

edm::Service<TFileService> IsoTrackCalibration::fs
private

Definition at line 93 of file IsoTrackCalibration.cc.

Referenced by beginJob().

TH1I* IsoTrackCalibration::h_iEta
private

Definition at line 130 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

TH1F * IsoTrackCalibration::h_jetp
private

Definition at line 132 of file IsoTrackCalibration.cc.

TH1F* IsoTrackCalibration::h_jetpt[4]
private

Definition at line 133 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

TH1F* IsoTrackCalibration::h_Rechit_E
private

Definition at line 132 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

TProfile* IsoTrackCalibration::h_RecHit_iEta
private

Definition at line 129 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

TProfile * IsoTrackCalibration::h_RecHit_num
private

Definition at line 129 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

TH1I * IsoTrackCalibration::h_tketa0[5]
private

Definition at line 130 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

TH1I * IsoTrackCalibration::h_tketa1[5]
private

Definition at line 130 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

TH1I * IsoTrackCalibration::h_tketa2[5]
private

Definition at line 130 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

TH1I* IsoTrackCalibration::h_tketa3[5]
private

Definition at line 131 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

TH1I * IsoTrackCalibration::h_tketa4[5]
private

Definition at line 131 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

TH1I * IsoTrackCalibration::h_tketa5[5]
private

Definition at line 131 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

TH1I* IsoTrackCalibration::h_tketav1[5][6]
private

Definition at line 134 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

TH1I * IsoTrackCalibration::h_tketav2[5][6]
private

Definition at line 134 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

HLTConfigProvider IsoTrackCalibration::hltConfig_
private

Definition at line 94 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginRun().

std::vector<std::string> IsoTrackCalibration::HLTNames
private

Definition at line 95 of file IsoTrackCalibration.cc.

std::string IsoTrackCalibration::l1Filter
private

Definition at line 100 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

std::string IsoTrackCalibration::l2Filter
private

Definition at line 100 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

std::string IsoTrackCalibration::l3Filter
private

Definition at line 100 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

int IsoTrackCalibration::nAll
private

Definition at line 104 of file IsoTrackCalibration.cc.

Referenced by analyze(), and endJob().

int IsoTrackCalibration::nGood
private

Definition at line 104 of file IsoTrackCalibration.cc.

Referenced by analyze(), and endJob().

int IsoTrackCalibration::nRun
private

Definition at line 104 of file IsoTrackCalibration.cc.

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

std::vector<double> IsoTrackCalibration::pbin
private

Definition at line 128 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

std::string IsoTrackCalibration::processName
private
double IsoTrackCalibration::pTrackMin_
private

Definition at line 102 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

bool IsoTrackCalibration::qcdMC
private

Definition at line 103 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

spr::trackSelectionParameters IsoTrackCalibration::selectionParameters
private

Definition at line 98 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

std::vector<unsigned int>* IsoTrackCalibration::t_DetIds
private

Definition at line 127 of file IsoTrackCalibration.cc.

Referenced by analyze(), beginJob(), and ~IsoTrackCalibration().

double IsoTrackCalibration::t_eHcal
private

Definition at line 123 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_eMipDR
private

Definition at line 123 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

int IsoTrackCalibration::t_Event
private

Definition at line 120 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_EventWeight
private

Definition at line 121 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

std::vector<double>* IsoTrackCalibration::t_HitEnergies
private

Definition at line 128 of file IsoTrackCalibration.cc.

Referenced by analyze(), beginJob(), and ~IsoTrackCalibration().

double IsoTrackCalibration::t_hmaxNearP
private

Definition at line 123 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

int IsoTrackCalibration::t_ieta
private

Definition at line 120 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_l1eta
private

Definition at line 121 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_l1phi
private

Definition at line 121 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_l1pt
private

Definition at line 121 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_l3eta
private

Definition at line 122 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_l3phi
private

Definition at line 122 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_l3pt
private

Definition at line 122 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_mindR1
private

Definition at line 122 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_mindR2
private

Definition at line 123 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_npvObserved
private

Definition at line 124 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_npvtruth
private

Definition at line 124 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

double IsoTrackCalibration::t_p
private

Definition at line 122 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

bool IsoTrackCalibration::t_qltyFlag
private

Definition at line 125 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

bool IsoTrackCalibration::t_qltyMissFlag
private

Definition at line 125 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

bool IsoTrackCalibration::t_qltyPVFlag
private

Definition at line 125 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

int IsoTrackCalibration::t_Run
private

Definition at line 120 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

bool IsoTrackCalibration::t_selectTk
private

Definition at line 125 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

std::vector<bool>* IsoTrackCalibration::t_trgbits
private

Definition at line 126 of file IsoTrackCalibration.cc.

Referenced by analyze(), beginJob(), and ~IsoTrackCalibration().

std::string IsoTrackCalibration::theTrackQuality
private

Definition at line 99 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

edm::InputTag IsoTrackCalibration::theTriggerResultsLabel
private

Definition at line 105 of file IsoTrackCalibration.cc.

Referenced by IsoTrackCalibration().

edm::EDGetTokenT<reco::BeamSpot> IsoTrackCalibration::tok_bs_
private

Definition at line 111 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

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

Definition at line 112 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

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

Definition at line 113 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

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

Definition at line 115 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

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

Definition at line 109 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

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

Definition at line 114 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

edm::EDGetTokenT<reco::GenJetCollection> IsoTrackCalibration::tok_jets_
private

Definition at line 116 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

edm::EDGetTokenT<std::vector<PileupSummaryInfo> > IsoTrackCalibration::tok_pu_
private

Definition at line 117 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

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

Definition at line 110 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

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

Definition at line 106 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

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

Definition at line 107 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

TTree* IsoTrackCalibration::tree
private
edm::InputTag IsoTrackCalibration::triggerEvent_
private

Definition at line 105 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().

std::vector<int> IsoTrackCalibration::trigKount
private

Definition at line 96 of file IsoTrackCalibration.cc.

Referenced by analyze(), endJob(), and IsoTrackCalibration().

std::vector<std::string> IsoTrackCalibration::trigNames
private

Definition at line 95 of file IsoTrackCalibration.cc.

Referenced by analyze(), endJob(), and IsoTrackCalibration().

std::vector<int> IsoTrackCalibration::trigPass
private

Definition at line 96 of file IsoTrackCalibration.cc.

Referenced by analyze(), endJob(), and IsoTrackCalibration().

std::vector<double> IsoTrackCalibration::vbin
private

Definition at line 128 of file IsoTrackCalibration.cc.

Referenced by analyze(), and beginJob().

int IsoTrackCalibration::verbosity
private

Definition at line 97 of file IsoTrackCalibration.cc.

Referenced by analyze(), and IsoTrackCalibration().