CMS 3D CMS Logo

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

#include <AnalysisRootpleProducer.h>

Inheritance diagram for AnalysisRootpleProducer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

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

Private Attributes

TClonesArray * acceptedTriggers
 
TTree * AnalysisTree
 
TClonesArray * CalorimeterJet
 
edm::Handle< std::vector< reco::GenParticle > > CandHandleMC
 
edm::Handle< reco::CandidateCollectionCandHandleRECO
 
TClonesArray * ChargedJet
 
edm::Handle< reco::GenJetCollectionChgGenJetsHandle
 
edm::EDGetTokenT< std::vector< reco::GenParticle > > chgGenPartCollToken
 
edm::EDGetTokenT< reco::GenJetCollectionchgJetCollToken
 
float EtaCJ [NCJMAX]
 
float EtaEHJ [NEHJMAX]
 
float EtaIJ [NIJMAX]
 
float EtaMC [NMCPMAX]
 
float EtaTJ [NTJMAX]
 
float EtaTK [NTKMAX]
 
int EventKind
 
edm::Handle< edm::HepMCProductEvtHandle
 
edm::Service< TFileServicefs
 
edm::EDGetTokenT< reco::GenJetCollectiongenJetCollToken
 
edm::Handle< reco::GenJetCollectionGenJetsHandle
 
TClonesArray * InclusiveJet
 
edm::EDGetTokenT< edm::HepMCProductmcEventToken
 
float MomentumCJ [NCJMAX]
 
float MomentumEHJ [NEHJMAX]
 
float MomentumIJ [NIJMAX]
 
float MomentumMC [NMCPMAX]
 
float MomentumTJ [NTJMAX]
 
float MomentumTK [NTKMAX]
 
TClonesArray * MonteCarlo
 
int NumberCaloJet
 
int NumberChargedJet
 
int NumberInclusiveJet
 
int NumberMCParticles
 
int NumberTracks
 
int NumberTracksJet
 
bool onlyRECO
 
float PhiCJ [NCJMAX]
 
float PhiEHJ [NEHJMAX]
 
float PhiIJ [NIJMAX]
 
float PhiMC [NMCPMAX]
 
float PhiTJ [NTJMAX]
 
float PhiTK [NTKMAX]
 
float piG
 
edm::EDGetTokenT< reco::CaloJetCollectionrecoCaloJetCollToken
 
edm::Handle< reco::CaloJetCollectionRecoCaloJetsHandle
 
TClonesArray * Track
 
edm::EDGetTokenT< reco::CandidateCollectiontracksCollToken
 
TClonesArray * TracksJet
 
edm::EDGetTokenT< reco::BasicJetCollectiontracksJetCollToken
 
edm::Handle< reco::BasicJetCollectionTracksJetsHandle
 
float TransverseMomentumCJ [NCJMAX]
 
float TransverseMomentumEHJ [NEHJMAX]
 
float TransverseMomentumIJ [NIJMAX]
 
float TransverseMomentumMC [NMCPMAX]
 
float TransverseMomentumTJ [NTJMAX]
 
float TransverseMomentumTK [NTKMAX]
 
edm::Handle< edm::TriggerResultstriggerResults
 
edm::EDGetTokenT< edm::TriggerResultstriggerResultsToken
 

Static Private Attributes

static const int NCJMAX = 10000
 
static const int NEHJMAX = 10000
 
static const int NIJMAX = 10000
 
static const int NMCPMAX = 10000
 
static const int NTJMAX = 10000
 
static const int NTKMAX = 10000
 

Additional Inherited Members

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

Detailed Description

Definition at line 40 of file AnalysisRootpleProducer.h.

Constructor & Destructor Documentation

AnalysisRootpleProducer::AnalysisRootpleProducer ( const edm::ParameterSet pset)
explicit

Definition at line 90 of file AnalysisRootpleProducer.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and HigPhotonJetHLTOfflineSource_cfi::triggerResultsToken.

90  {
91  // flag to ignore gen-level analysis
92  onlyRECO = pset.getUntrackedParameter<bool>("OnlyRECO", false);
93 
94  // particle, track and jet collections
95  mcEventToken = mayConsume<edm::HepMCProduct>(pset.getUntrackedParameter<InputTag>("MCEvent", std::string("")));
97  mayConsume<reco::GenJetCollection>(pset.getUntrackedParameter<InputTag>("GenJetCollectionName", std::string("")));
98  chgJetCollToken = mayConsume<reco::GenJetCollection>(
99  pset.getUntrackedParameter<InputTag>("ChgGenJetCollectionName", std::string("")));
100  tracksJetCollToken = consumes<reco::BasicJetCollection>(
101  pset.getUntrackedParameter<InputTag>("TracksJetCollectionName", std::string("")));
102  recoCaloJetCollToken = consumes<reco::CaloJetCollection>(
103  pset.getUntrackedParameter<InputTag>("RecoCaloJetCollectionName", std::string("")));
104  chgGenPartCollToken = mayConsume<std::vector<reco::GenParticle> >(
105  pset.getUntrackedParameter<InputTag>("ChgGenPartCollectionName", std::string("")));
106  tracksCollToken = consumes<reco::CandidateCollection>(
107  pset.getUntrackedParameter<InputTag>("TracksCollectionName", std::string("")));
108 
109  // trigger results
110  triggerResultsToken = consumes<edm::TriggerResults>(pset.getParameter<InputTag>("triggerResults"));
111  // hltFilterTag = pset.getParameter<InputTag>("hltFilter");
112  // triggerName = pset.getParameter<InputTag>("triggerName");
113 
114  piG = acos(-1.);
115  NumberMCParticles = 0;
116  NumberTracks = 0;
117  NumberInclusiveJet = 0;
118  NumberChargedJet = 0;
119  NumberTracksJet = 0;
120  NumberCaloJet = 0;
121 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::CandidateCollection > tracksCollToken
edm::EDGetTokenT< reco::GenJetCollection > chgJetCollToken
edm::EDGetTokenT< reco::GenJetCollection > genJetCollToken
edm::EDGetTokenT< reco::BasicJetCollection > tracksJetCollToken
edm::EDGetTokenT< edm::HepMCProduct > mcEventToken
edm::EDGetTokenT< std::vector< reco::GenParticle > > chgGenPartCollToken
edm::EDGetTokenT< reco::CaloJetCollection > recoCaloJetCollToken
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
AnalysisRootpleProducer::~AnalysisRootpleProducer ( )
inlineoverride

Member Function Documentation

void AnalysisRootpleProducer::analyze ( const edm::Event e,
const edm::EventSetup  
)
override

Definition at line 199 of file AnalysisRootpleProducer.cc.

References HLT_2018_cff::fillTracks, nanoDQM_cfi::GenPart, edm::Event::getByToken(), HLT_2018_cff::MonteCarlo, gather_cfg::Tracks, edm::TriggerNames::triggerName(), L1TEGammaOffline_cfi::triggerNames, edm::Event::triggerNames(), edm::triggerResults(), and HigPhotonJetHLTOfflineSource_cfi::triggerResultsToken.

Referenced by ~AnalysisRootpleProducer().

199  {
202 
203  acceptedTriggers->Clear();
204  unsigned int iAcceptedTriggers(0);
205  if (triggerResults.product()->wasrun()) {
206  //cout << "at least one path out of " << triggerResults.product()->size() << " ran? " << triggerResults.product()->wasrun() << endl;
207 
208  if (triggerResults.product()->accept()) {
209  //cout << endl << "at least one path accepted? " << triggerResults.product()->accept() << endl;
210 
211  const unsigned int n_TriggerResults(triggerResults.product()->size());
212  for (unsigned int itrig(0); itrig < n_TriggerResults; ++itrig) {
213  if (triggerResults.product()->accept(itrig)) {
214  //cout << "path " << triggerNames.triggerName( itrig );
215  //cout << ", module index " << triggerResults.product()->index( itrig );
216  //cout << ", state (Ready = 0, Pass = 1, Fail = 2, Exception = 3) " << triggerResults.product()->state( itrig );
217  //cout << ", accept " << triggerResults.product()->accept( itrig );
218  //cout << endl;
219 
220  // save name of accepted trigger path
221  new ((*acceptedTriggers)[iAcceptedTriggers]) TObjString((triggerNames.triggerName(itrig)).c_str());
222  ++iAcceptedTriggers;
223  }
224  }
225  }
226  }
227 
228  // gen level analysis
229  // skipped, if onlyRECO flag set to true
230 
231  if (!onlyRECO) {
236 
237  const HepMC::GenEvent* Evt = EvtHandle->GetEvent();
238 
239  EventKind = Evt->signal_process_id();
240 
241  std::vector<math::XYZTLorentzVector> GenPart;
242  std::vector<GenJet> ChgGenJetContainer;
243  std::vector<GenJet> GenJetContainer;
244 
245  GenPart.clear();
246  ChgGenJetContainer.clear();
247  GenJetContainer.clear();
248  MonteCarlo->Clear();
249  InclusiveJet->Clear();
250  ChargedJet->Clear();
251 
252  // jets from charged particles at hadron level
253  if (!ChgGenJetsHandle->empty()) {
254  for (GenJetCollection::const_iterator it(ChgGenJetsHandle->begin()), itEnd(ChgGenJetsHandle->end()); it != itEnd;
255  ++it) {
256  ChgGenJetContainer.push_back(*it);
257  }
258 
259  std::stable_sort(ChgGenJetContainer.begin(), ChgGenJetContainer.end(), GenJetSort());
260 
261  std::vector<GenJet>::const_iterator it(ChgGenJetContainer.begin()), itEnd(ChgGenJetContainer.end());
262  for (int iChargedJet(0); it != itEnd; ++it, ++iChargedJet) {
263  fillChargedJet(it->p(), it->pt(), it->eta(), it->phi());
264  new ((*ChargedJet)[iChargedJet]) TLorentzVector(it->px(), it->py(), it->pz(), it->energy());
265  }
266  }
267 
268  // GenJets
269  if (!GenJetsHandle->empty()) {
270  for (GenJetCollection::const_iterator it(GenJetsHandle->begin()), itEnd(GenJetsHandle->end()); it != itEnd;
271  ++it) {
272  GenJetContainer.push_back(*it);
273  }
274 
275  std::stable_sort(GenJetContainer.begin(), GenJetContainer.end(), GenJetSort());
276 
277  std::vector<GenJet>::const_iterator it(GenJetContainer.begin()), itEnd(GenJetContainer.end());
278  for (int iInclusiveJet(0); it != itEnd; ++it, ++iInclusiveJet) {
279  fillInclusiveJet(it->p(), it->pt(), it->eta(), it->phi());
280  new ((*InclusiveJet)[iInclusiveJet]) TLorentzVector(it->px(), it->py(), it->pz(), it->energy());
281  }
282  }
283 
284  // hadron level particles
285  if (!CandHandleMC->empty()) {
286  for (vector<GenParticle>::const_iterator it(CandHandleMC->begin()), itEnd(CandHandleMC->end()); it != itEnd;
287  it++) {
288  GenPart.push_back(it->p4());
289  }
290 
291  std::stable_sort(GenPart.begin(), GenPart.end(), GreaterPt());
292 
293  std::vector<math::XYZTLorentzVector>::const_iterator it(GenPart.begin()), itEnd(GenPart.end());
294  for (int iMonteCarlo(0); it != itEnd; ++it, ++iMonteCarlo) {
295  fillMCParticles(it->P(), it->Pt(), it->Eta(), it->Phi());
296  new ((*MonteCarlo)[iMonteCarlo]) TLorentzVector(it->Px(), it->Py(), it->Pz(), it->E());
297  }
298  }
299  }
300 
301  // reco level analysis
302 
306 
307  std::vector<math::XYZTLorentzVector> Tracks;
308  std::vector<BasicJet> TracksJetContainer;
309  std::vector<CaloJet> RecoCaloJetContainer;
310 
311  Tracks.clear();
312  TracksJetContainer.clear();
313  RecoCaloJetContainer.clear();
314 
315  Track->Clear();
316  TracksJet->Clear();
317  CalorimeterJet->Clear();
318 
319  if (!RecoCaloJetsHandle->empty()) {
320  for (CaloJetCollection::const_iterator it(RecoCaloJetsHandle->begin()), itEnd(RecoCaloJetsHandle->end());
321  it != itEnd;
322  ++it) {
323  RecoCaloJetContainer.push_back(*it);
324  }
325  std::stable_sort(RecoCaloJetContainer.begin(), RecoCaloJetContainer.end(), CaloJetSort());
326 
327  std::vector<CaloJet>::const_iterator it(RecoCaloJetContainer.begin()), itEnd(RecoCaloJetContainer.end());
328  for (int iCalorimeterJet(0); it != itEnd; ++it, ++iCalorimeterJet) {
329  fillCaloJet(it->p(), it->pt(), it->eta(), it->phi());
330  new ((*CalorimeterJet)[iCalorimeterJet]) TLorentzVector(it->px(), it->py(), it->pz(), it->energy());
331  }
332  }
333 
334  if (!TracksJetsHandle->empty()) {
335  for (BasicJetCollection::const_iterator it(TracksJetsHandle->begin()), itEnd(TracksJetsHandle->end()); it != itEnd;
336  ++it) {
337  TracksJetContainer.push_back(*it);
338  }
339  std::stable_sort(TracksJetContainer.begin(), TracksJetContainer.end(), BasicJetSort());
340 
341  std::vector<BasicJet>::const_iterator it(TracksJetContainer.begin()), itEnd(TracksJetContainer.end());
342  for (int iTracksJet(0); it != itEnd; ++it, ++iTracksJet) {
343  fillTracksJet(it->p(), it->pt(), it->eta(), it->phi());
344  new ((*TracksJet)[iTracksJet]) TLorentzVector(it->px(), it->py(), it->pz(), it->energy());
345  }
346  }
347 
348  if (!CandHandleRECO->empty()) {
349  for (CandidateCollection::const_iterator it(CandHandleRECO->begin()), itEnd(CandHandleRECO->end()); it != itEnd;
350  ++it) {
351  Tracks.push_back(it->p4());
352  }
353  std::stable_sort(Tracks.begin(), Tracks.end(), GreaterPt());
354 
355  std::vector<math::XYZTLorentzVector>::const_iterator it(Tracks.begin()), itEnd(Tracks.end());
356  for (int iTracks(0); it != itEnd; ++it, ++iTracks) {
357  fillTracks(it->P(), it->Pt(), it->Eta(), it->Phi());
358  new ((*Track)[iTracks]) TLorentzVector(it->Px(), it->Py(), it->Pz(), it->E());
359  }
360  }
361 
362  store();
363 }
edm::Handle< std::vector< reco::GenParticle > > CandHandleMC
bool wasrun() const
Was at least one path run?
void fillTracks(float, float, float, float)
edm::EDGetTokenT< reco::CandidateCollection > tracksCollToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void fillTracksJet(float, float, float, float)
bool accept() const
Has at least one path accepted the event?
void fillChargedJet(float, float, float, float)
void fillInclusiveJet(float, float, float, float)
edm::EDGetTokenT< reco::GenJetCollection > chgJetCollToken
edm::Handle< reco::GenJetCollection > ChgGenJetsHandle
iterator begin()
Definition: OwnVector.h:280
edm::EDGetTokenT< reco::GenJetCollection > genJetCollToken
edm::Handle< reco::CandidateCollection > CandHandleRECO
edm::Handle< edm::TriggerResults > triggerResults
unsigned int size() const
Get number of paths stored.
bool empty() const
Definition: OwnVector.h:305
edm::Handle< reco::BasicJetCollection > TracksJetsHandle
edm::Handle< reco::GenJetCollection > GenJetsHandle
edm::EDGetTokenT< reco::BasicJetCollection > tracksJetCollToken
edm::EDGetTokenT< edm::HepMCProduct > mcEventToken
iterator end()
Definition: OwnVector.h:285
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:34
T const * product() const
Definition: Handle.h:69
void fillCaloJet(float, float, float, float)
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:22
edm::Handle< reco::CaloJetCollection > RecoCaloJetsHandle
edm::EDGetTokenT< std::vector< reco::GenParticle > > chgGenPartCollToken
edm::EDGetTokenT< reco::CaloJetCollection > recoCaloJetCollToken
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
edm::Handle< edm::HepMCProduct > EvtHandle
void fillMCParticles(float, float, float, float)
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:265
void AnalysisRootpleProducer::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 123 of file AnalysisRootpleProducer.cc.

References HLT_2018_cff::MonteCarlo.

Referenced by ~AnalysisRootpleProducer().

123  {
124  // use TFileService for output to root file
125  AnalysisTree = fs->make<TTree>("AnalysisTree", "MBUE Analysis Tree ");
126 
127  AnalysisTree->Branch("EventKind", &EventKind, "EventKind/I");
128 
129  // store p, pt, eta, phi for particles and jets
130 
131  // GenParticles at hadron level
132  AnalysisTree->Branch("NumberMCParticles", &NumberMCParticles, "NumberMCParticles/I");
133  AnalysisTree->Branch("MomentumMC", MomentumMC, "MomentumMC[NumberMCParticles]/F");
134  AnalysisTree->Branch("TransverseMomentumMC", TransverseMomentumMC, "TransverseMomentumMC[NumberMCParticles]/F");
135  AnalysisTree->Branch("EtaMC", EtaMC, "EtaMC[NumberMCParticles]/F");
136  AnalysisTree->Branch("PhiMC", PhiMC, "PhiMC[NumberMCParticles]/F");
137 
138  // tracks
139  AnalysisTree->Branch("NumberTracks", &NumberTracks, "NumberTracks/I");
140  AnalysisTree->Branch("MomentumTK", MomentumTK, "MomentumTK[NumberTracks]/F");
141  AnalysisTree->Branch("TrasverseMomentumTK", TransverseMomentumTK, "TransverseMomentumTK[NumberTracks]/F");
142  AnalysisTree->Branch("EtaTK", EtaTK, "EtaTK[NumberTracks]/F");
143  AnalysisTree->Branch("PhiTK", PhiTK, "PhiTK[NumberTracks]/F");
144 
145  // GenJets
146  AnalysisTree->Branch("NumberInclusiveJet", &NumberInclusiveJet, "NumberInclusiveJet/I");
147  AnalysisTree->Branch("MomentumIJ", MomentumIJ, "MomentumIJ[NumberInclusiveJet]/F");
148  AnalysisTree->Branch("TrasverseMomentumIJ", TransverseMomentumIJ, "TransverseMomentumIJ[NumberInclusiveJet]/F");
149  AnalysisTree->Branch("EtaIJ", EtaIJ, "EtaIJ[NumberInclusiveJet]/F");
150  AnalysisTree->Branch("PhiIJ", PhiIJ, "PhiIJ[NumberInclusiveJet]/F");
151 
152  // jets from charged GenParticles
153  AnalysisTree->Branch("NumberChargedJet", &NumberChargedJet, "NumberChargedJet/I");
154  AnalysisTree->Branch("MomentumCJ", MomentumCJ, "MomentumCJ[NumberChargedJet]/F");
155  AnalysisTree->Branch("TrasverseMomentumCJ", TransverseMomentumCJ, "TransverseMomentumCJ[NumberChargedJet]/F");
156  AnalysisTree->Branch("EtaCJ", EtaCJ, "EtaCJ[NumberChargedJet]/F");
157  AnalysisTree->Branch("PhiCJ", PhiCJ, "PhiCJ[NumberChargedJet]/F");
158 
159  // jets from tracks
160  AnalysisTree->Branch("NumberTracksJet", &NumberTracksJet, "NumberTracksJet/I");
161  AnalysisTree->Branch("MomentumTJ", MomentumTJ, "MomentumTJ[NumberTracksJet]/F");
162  AnalysisTree->Branch("TrasverseMomentumTJ", TransverseMomentumTJ, "TransverseMomentumTJ[NumberTracksJet]/F");
163  AnalysisTree->Branch("EtaTJ", EtaTJ, "EtaTJ[NumberTracksJet]/F");
164  AnalysisTree->Branch("PhiTJ", PhiTJ, "PhiTJ[NumberTracksJet]/F");
165 
166  // jets from calorimeter towers
167  AnalysisTree->Branch("NumberCaloJet", &NumberCaloJet, "NumberCaloJet/I");
168  AnalysisTree->Branch("MomentumEHJ", MomentumEHJ, "MomentumEHJ[NumberCaloJet]/F");
169  AnalysisTree->Branch("TrasverseMomentumEHJ", TransverseMomentumEHJ, "TransverseMomentumEHJ[NumberCaloJet]/F");
170  AnalysisTree->Branch("EtaEHJ", EtaEHJ, "EtaEHJ[NumberCaloJet]/F");
171  AnalysisTree->Branch("PhiEHJ", PhiEHJ, "PhiEHJ[NumberCaloJet]/F");
172 
173  // alternative storage method:
174  // save TClonesArrays of TLorentzVectors
175  // i.e. store 4-vectors of particles and jets
176 
177  MonteCarlo = new TClonesArray("TLorentzVector", 10000);
178  AnalysisTree->Branch("MonteCarlo", "TClonesArray", &MonteCarlo, 128000, 0);
179 
180  Track = new TClonesArray("TLorentzVector", 10000);
181  AnalysisTree->Branch("Track", "TClonesArray", &Track, 128000, 0);
182 
183  InclusiveJet = new TClonesArray("TLorentzVector", 10000);
184  AnalysisTree->Branch("InclusiveJet", "TClonesArray", &InclusiveJet, 128000, 0);
185 
186  ChargedJet = new TClonesArray("TLorentzVector", 10000);
187  AnalysisTree->Branch("ChargedJet", "TClonesArray", &ChargedJet, 128000, 0);
188 
189  TracksJet = new TClonesArray("TLorentzVector", 10000);
190  AnalysisTree->Branch("TracksJet", "TClonesArray", &TracksJet, 128000, 0);
191 
192  CalorimeterJet = new TClonesArray("TLorentzVector", 10000);
193  AnalysisTree->Branch("CalorimeterJet", "TClonesArray", &CalorimeterJet, 128000, 0);
194 
195  acceptedTriggers = new TClonesArray("TObjString", 10000);
196  AnalysisTree->Branch("acceptedTriggers", "TClonesArray", &acceptedTriggers, 128000, 0);
197 }
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
edm::Service< TFileService > fs
void AnalysisRootpleProducer::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 365 of file AnalysisRootpleProducer.cc.

Referenced by ~AnalysisRootpleProducer().

365 {}
void AnalysisRootpleProducer::fillCaloJet ( float  p,
float  pt,
float  eta,
float  phi 
)
void AnalysisRootpleProducer::fillChargedJet ( float  p,
float  pt,
float  eta,
float  phi 
)
void AnalysisRootpleProducer::fillEventInfo ( int  e)
void AnalysisRootpleProducer::fillInclusiveJet ( float  p,
float  pt,
float  eta,
float  phi 
)
void AnalysisRootpleProducer::fillMCParticles ( float  p,
float  pt,
float  eta,
float  phi 
)
void AnalysisRootpleProducer::fillTracks ( float  p,
float  pt,
float  eta,
float  phi 
)
void AnalysisRootpleProducer::fillTracksJet ( float  p,
float  pt,
float  eta,
float  phi 
)
void AnalysisRootpleProducer::store ( )

Member Data Documentation

TClonesArray* AnalysisRootpleProducer::acceptedTriggers
private

Definition at line 110 of file AnalysisRootpleProducer.h.

TTree* AnalysisRootpleProducer::AnalysisTree
private

Definition at line 86 of file AnalysisRootpleProducer.h.

TClonesArray* AnalysisRootpleProducer::CalorimeterJet
private

Definition at line 109 of file AnalysisRootpleProducer.h.

edm::Handle<std::vector<reco::GenParticle> > AnalysisRootpleProducer::CandHandleMC
private

Definition at line 73 of file AnalysisRootpleProducer.h.

edm::Handle<reco::CandidateCollection> AnalysisRootpleProducer::CandHandleRECO
private

Definition at line 76 of file AnalysisRootpleProducer.h.

TClonesArray* AnalysisRootpleProducer::ChargedJet
private

Definition at line 106 of file AnalysisRootpleProducer.h.

edm::Handle<reco::GenJetCollection> AnalysisRootpleProducer::ChgGenJetsHandle
private

Definition at line 75 of file AnalysisRootpleProducer.h.

edm::EDGetTokenT<std::vector<reco::GenParticle> > AnalysisRootpleProducer::chgGenPartCollToken
private

Definition at line 66 of file AnalysisRootpleProducer.h.

edm::EDGetTokenT<reco::GenJetCollection> AnalysisRootpleProducer::chgJetCollToken
private

Definition at line 65 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::EtaCJ[NCJMAX]
private

Definition at line 100 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::EtaEHJ[NEHJMAX]
private

Definition at line 102 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::EtaIJ[NIJMAX]
private

Definition at line 99 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::EtaMC[NMCPMAX]
private

Definition at line 97 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::EtaTJ[NTJMAX]
private

Definition at line 101 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::EtaTK[NTKMAX]
private

Definition at line 98 of file AnalysisRootpleProducer.h.

int AnalysisRootpleProducer::EventKind
private

Definition at line 95 of file AnalysisRootpleProducer.h.

edm::Handle<edm::HepMCProduct> AnalysisRootpleProducer::EvtHandle
private

Definition at line 72 of file AnalysisRootpleProducer.h.

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

Definition at line 82 of file AnalysisRootpleProducer.h.

edm::EDGetTokenT<reco::GenJetCollection> AnalysisRootpleProducer::genJetCollToken
private

Definition at line 64 of file AnalysisRootpleProducer.h.

edm::Handle<reco::GenJetCollection> AnalysisRootpleProducer::GenJetsHandle
private

Definition at line 74 of file AnalysisRootpleProducer.h.

TClonesArray* AnalysisRootpleProducer::InclusiveJet
private

Definition at line 105 of file AnalysisRootpleProducer.h.

edm::EDGetTokenT<edm::HepMCProduct> AnalysisRootpleProducer::mcEventToken
private

Definition at line 63 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::MomentumCJ[NCJMAX]
private

Definition at line 100 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::MomentumEHJ[NEHJMAX]
private

Definition at line 102 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::MomentumIJ[NIJMAX]
private

Definition at line 99 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::MomentumMC[NMCPMAX]
private

Definition at line 97 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::MomentumTJ[NTJMAX]
private

Definition at line 101 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::MomentumTK[NTKMAX]
private

Definition at line 98 of file AnalysisRootpleProducer.h.

TClonesArray* AnalysisRootpleProducer::MonteCarlo
private

Definition at line 104 of file AnalysisRootpleProducer.h.

const int AnalysisRootpleProducer::NCJMAX = 10000
staticprivate

Definition at line 91 of file AnalysisRootpleProducer.h.

const int AnalysisRootpleProducer::NEHJMAX = 10000
staticprivate

Definition at line 93 of file AnalysisRootpleProducer.h.

const int AnalysisRootpleProducer::NIJMAX = 10000
staticprivate

Definition at line 90 of file AnalysisRootpleProducer.h.

const int AnalysisRootpleProducer::NMCPMAX = 10000
staticprivate

Definition at line 88 of file AnalysisRootpleProducer.h.

const int AnalysisRootpleProducer::NTJMAX = 10000
staticprivate

Definition at line 92 of file AnalysisRootpleProducer.h.

const int AnalysisRootpleProducer::NTKMAX = 10000
staticprivate

Definition at line 89 of file AnalysisRootpleProducer.h.

int AnalysisRootpleProducer::NumberCaloJet
private

Definition at line 95 of file AnalysisRootpleProducer.h.

int AnalysisRootpleProducer::NumberChargedJet
private

Definition at line 95 of file AnalysisRootpleProducer.h.

int AnalysisRootpleProducer::NumberInclusiveJet
private

Definition at line 95 of file AnalysisRootpleProducer.h.

int AnalysisRootpleProducer::NumberMCParticles
private

Definition at line 95 of file AnalysisRootpleProducer.h.

int AnalysisRootpleProducer::NumberTracks
private

Definition at line 95 of file AnalysisRootpleProducer.h.

int AnalysisRootpleProducer::NumberTracksJet
private

Definition at line 95 of file AnalysisRootpleProducer.h.

bool AnalysisRootpleProducer::onlyRECO
private

Definition at line 61 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::PhiCJ[NCJMAX]
private

Definition at line 100 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::PhiEHJ[NEHJMAX]
private

Definition at line 102 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::PhiIJ[NIJMAX]
private

Definition at line 99 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::PhiMC[NMCPMAX]
private

Definition at line 97 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::PhiTJ[NTJMAX]
private

Definition at line 101 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::PhiTK[NTKMAX]
private

Definition at line 98 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::piG
private

Definition at line 84 of file AnalysisRootpleProducer.h.

edm::EDGetTokenT<reco::CaloJetCollection> AnalysisRootpleProducer::recoCaloJetCollToken
private

Definition at line 68 of file AnalysisRootpleProducer.h.

edm::Handle<reco::CaloJetCollection> AnalysisRootpleProducer::RecoCaloJetsHandle
private

Definition at line 78 of file AnalysisRootpleProducer.h.

TClonesArray* AnalysisRootpleProducer::Track
private

Definition at line 107 of file AnalysisRootpleProducer.h.

edm::EDGetTokenT<reco::CandidateCollection> AnalysisRootpleProducer::tracksCollToken
private

Definition at line 69 of file AnalysisRootpleProducer.h.

TClonesArray* AnalysisRootpleProducer::TracksJet
private

Definition at line 108 of file AnalysisRootpleProducer.h.

edm::EDGetTokenT<reco::BasicJetCollection> AnalysisRootpleProducer::tracksJetCollToken
private

Definition at line 67 of file AnalysisRootpleProducer.h.

edm::Handle<reco::BasicJetCollection> AnalysisRootpleProducer::TracksJetsHandle
private

Definition at line 77 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::TransverseMomentumCJ[NCJMAX]
private

Definition at line 100 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::TransverseMomentumEHJ[NEHJMAX]
private

Definition at line 102 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::TransverseMomentumIJ[NIJMAX]
private

Definition at line 99 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::TransverseMomentumMC[NMCPMAX]
private

Definition at line 97 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::TransverseMomentumTJ[NTJMAX]
private

Definition at line 101 of file AnalysisRootpleProducer.h.

float AnalysisRootpleProducer::TransverseMomentumTK[NTKMAX]
private

Definition at line 98 of file AnalysisRootpleProducer.h.

edm::Handle<edm::TriggerResults> AnalysisRootpleProducer::triggerResults
private

Definition at line 79 of file AnalysisRootpleProducer.h.

edm::EDGetTokenT<edm::TriggerResults> AnalysisRootpleProducer::triggerResultsToken
private

Definition at line 70 of file AnalysisRootpleProducer.h.