CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
cms::GammaJetAnalysis Class Reference

#include <GammaJetAnalysis.h>

Inheritance diagram for cms::GammaJetAnalysis:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 
 GammaJetAnalysis (const edm::ParameterSet &)
 
 ~GammaJetAnalysis ()
 
- 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool allowMissingInputs_
 
int Code [4000]
 
double CutOnEgammaEnergy_
 
int EcalClusDet [20]
 
std::string ecalInput_
 
float ecut [3][3]
 
int event
 
std::string fOutputFileName
 
std::string gammaClus_
 
float GammaIsoEcal [9][20]
 
float GammaIsoHcal [9][20]
 
float GammaRecoEt [20]
 
float GammaRecoEta [20]
 
float GammaRecoPhi [20]
 
const CaloGeometrygeo
 
std::string hbheInput_
 
float HcalDet [8000]
 
float HcalRecoEt [8000]
 
float HcalRecoEta [8000]
 
float HcalRecoPhi [8000]
 
std::string hfInput_
 
std::string hoInput_
 
TFile * hOutputFile
 
std::string jetCalo_
 
float JetGenEt [10]
 
float JetGenEta [10]
 
float JetGenPhi [10]
 
float JetGenType [10]
 
float JetRecoEt [10]
 
float JetRecoEta [10]
 
float JetRecoPhi [10]
 
float JetRecoType [10]
 
int Mother1 [4000]
 
std::string myName
 
std::ofstream * myout_ecal
 
std::ofstream * myout_hcal
 
std::ofstream * myout_jet
 
std::ofstream * myout_part
 
std::ofstream * myout_photon
 
TTree * myTree
 
std::string nameProd_
 
int NumGenJets
 
int NumPart
 
int NumRecoGamma
 
int NumRecoHcal
 
int NumRecoJets
 
int NumRecoTrack
 
float parte [4000]
 
float partm [4000]
 
float partpx [4000]
 
float partpy [4000]
 
float partpz [4000]
 
float partvt [4000]
 
float partvx [4000]
 
float partvy [4000]
 
float partvz [4000]
 
float risol [3]
 
int run
 
int Status [4000]
 
edm::EDGetTokenT
< EcalRecHitCollection
tok_ecal_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
tok_egamma_
 
edm::EDGetTokenT
< HBHERecHitCollection
tok_hbhe_
 
edm::EDGetTokenT
< HFRecHitCollection
tok_hf_
 
edm::EDGetTokenT
< HORecHitCollection
tok_ho_
 
edm::EDGetTokenT
< reco::CaloJetCollection
tok_jets_
 
float TrackRecoEt [10]
 
float TrackRecoEta [10]
 
float TrackRecoPhi [10]
 
std::string Tracks_
 
bool useMC
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 51 of file GammaJetAnalysis.h.

Constructor & Destructor Documentation

cms::GammaJetAnalysis::GammaJetAnalysis ( const edm::ParameterSet iConfig)
explicit

Definition at line 43 of file GammaJetAnalysis.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and PatBasicFWLiteJetAnalyzer_Selector_cfg::useMC.

44 {
45  // get names of modules, producing object collections
46 
47  nameProd_ = iConfig.getUntrackedParameter<std::string>("nameProd");
48  jetCalo_ = iConfig.getUntrackedParameter<std::string>("jetCalo","GammaJetJetBackToBackCollection");
49 
50  tok_jets_ = consumes<reco::CaloJetCollection>( edm::InputTag(nameProd_,
51  jetCalo_) );
52 
53  gammaClus_ = iConfig.getUntrackedParameter<std::string>("gammaClus","GammaJetGammaBackToBackCollection");
54 
55  tok_egamma_ = consumes<reco::SuperClusterCollection>( edm::InputTag(nameProd_,
56  gammaClus_) );
57 
58  ecalInput_=iConfig.getUntrackedParameter<std::string>("ecalInput","GammaJetEcalRecHitCollection");
59 
60  tok_ecal_ = consumes<EcalRecHitCollection>( edm::InputTag(nameProd_, ecalInput_) );
61 
62  hbheInput_ = iConfig.getUntrackedParameter<std::string>("hbheInput");
63 
64  tok_hbhe_ = consumes<HBHERecHitCollection>(edm::InputTag(nameProd_,hbheInput_));
65 
66  hoInput_ = iConfig.getUntrackedParameter<std::string>("hoInput");
67 
68  tok_ho_ = consumes<HORecHitCollection>(edm::InputTag(nameProd_,hoInput_));
69 
70  hfInput_ = iConfig.getUntrackedParameter<std::string>("hfInput");
71 
72  tok_hf_ = consumes<HFRecHitCollection>(edm::InputTag(nameProd_,hfInput_));
73 
74  Tracks_ = iConfig.getUntrackedParameter<std::string>("Tracks","GammaJetTracksCollection");
75  CutOnEgammaEnergy_ = iConfig.getParameter<double>("CutOnEgammaEnergy");
76 
77  myName = iConfig.getParameter<std::string> ("textout");
78  useMC = iConfig.getParameter<bool>("useMCInfo");
79  allowMissingInputs_=iConfig.getUntrackedParameter<bool>("AllowMissingInputs",false);
80  // get name of output file with histogramms
81  fOutputFileName = iConfig.getUntrackedParameter<string>("HistOutFile");
82  risol[0] = 0.5;
83  risol[1] = 0.7;
84  risol[2] = 1.0;
85 
86  ecut[0][0] = 0.09;
87  ecut[0][1] = 0.18;
88  ecut[0][2] = 0.27;
89 
90  ecut[1][0] = 0.45;
91  ecut[1][1] = 0.9;
92  ecut[1][2] = 1.35;
93 
94  ecut[2][0] = 0.5;
95  ecut[2][1] = 1.;
96  ecut[2][2] = 1.5;
97 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
edm::EDGetTokenT< EcalRecHitCollection > tok_ecal_
edm::EDGetTokenT< HORecHitCollection > tok_ho_
edm::EDGetTokenT< reco::CaloJetCollection > tok_jets_
edm::EDGetTokenT< reco::SuperClusterCollection > tok_egamma_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
cms::GammaJetAnalysis::~GammaJetAnalysis ( )

Definition at line 100 of file GammaJetAnalysis.cc.

101 {
102 
103  // do anything here that needs to be done at desctruction time
104  // (e.g. close files, deallocate resources etc.)
105 
106 }

Member Function Documentation

void cms::GammaJetAnalysis::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 180 of file GammaJetAnalysis.cc.

References Reference_intrackfit_cff::barrel, gather_cfg::cout, cond::rpcobgas::detid, alignCSCRings::e, DetId::Ecal, PV3DBase< T, PVType, FrameType >::eta(), eta(), edm::EventID::event(), edm::EventSetup::get(), edm::Event::getAllProvenance(), edm::Event::getByToken(), DetId::Hcal, i, edm::EventBase::id(), cuy::ii, j, metsig::jet, fwrapper::jets, phi, PV3DBase< T, PVType, FrameType >::phi(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), dt_dqm_sourceclient_common_cff::reco, edm::EventID::run(), DTTTrigCorrFirst::run, and mathSSE::sqrt().

181 {
182 
184  iSetup.get<CaloGeometryRecord>().get(pG);
185  geo = pG.product();
186 
187 
188  using namespace edm;
189  std::vector<Provenance const*> theProvenance;
190  iEvent.getAllProvenance(theProvenance);
191 // for( std::vector<Provenance const*>::const_iterator ip = theProvenance.begin();
192 // ip != theProvenance.end(); ip++)
193 // {
194 // cout<<" Print all module/label names "<<(**ip).moduleName()<<" "<<(**ip).moduleLabel()<<
195 // " "<<(**ip).productInstanceName()<<endl;
196 // }
197 // Load generator information
198 // write HEPEVT block into file
199  run = iEvent.id().run();
200  event = iEvent.id().event();
201  (*myout_part)<<"Event "<<iEvent.id().run()<<" "<<iEvent.id().event()<<endl;
202  (*myout_jet)<<"Event "<<iEvent.id().run()<<" "<<iEvent.id().event()<<endl;
203  (*myout_hcal)<<"Event "<<iEvent.id().run()<<" "<<iEvent.id().event()<<endl;
204  (*myout_ecal)<<"Event "<<iEvent.id().run()<<" "<<iEvent.id().event()<<endl;
205  (*myout_photon)<<"Event "<<iEvent.id().run()<<" "<<iEvent.id().event()<<endl;
206 
207 
208  std::vector<edm::InputTag>::const_iterator ic;
209  int jettype = 0;
210  int jetexist = -100;
211  int reco = 1;
212  double etlost = -100.1;
213 
214  NumRecoJets = 0;
215 
216  try {
217 
219  iEvent.getByToken(tok_jets_, jets);
220  reco::CaloJetCollection::const_iterator jet = jets->begin ();
221  cout<<" Size of Calo jets "<<jets->size()<<endl;
222  jettype++;
223 
224  if(jets->size() > 0 )
225  {
226  int ij = 0;
227  for (; jet != jets->end (); jet++)
228  {
229  cout<<" Jet et "<<(*jet).et()<<" "<<(*jet).eta()<<" "<<(*jet).phi()<<endl;
230  ij++;
231  if(ij<4) (*myout_jet)<<jettype<<" "<<reco<<" "<<ij<<" "<<(*jet).et()<<" "<<(*jet).eta()<<" "<<(*jet).phi()
232  <<" "<<iEvent.id().event()<<endl;
233  jetexist = ij;
234  if( NumRecoJets < 8 )
235  {
236  JetRecoEt[NumRecoJets] = (*jet).et();
237  JetRecoEta[NumRecoJets] = (*jet).eta();
238  JetRecoPhi[NumRecoJets] = (*jet).phi();
239  JetRecoType[NumRecoJets] = jettype;
240  NumRecoJets++;
241  }
242  }
243  }
244  } catch (cms::Exception& e) { // can't find it!
245  if (!allowMissingInputs_) {
246  cout<< " Calojets are missed "<<endl;
247  throw e;
248  }
249  }
250 
251  cout<<" We filled CaloJet part "<<jetexist<<endl;
252 
253  if( jetexist < 0 ) (*myout_jet)<<jetexist<<" "<<reco<<" "<<etlost
254  <<" "<<etlost<<" "<<etlost
255  <<" "<<iEvent.id().event()<<endl;
256 // Load EcalRecHits
257 
258  std::vector<edm::InputTag>::const_iterator i;
259  vector<std::pair<DetId, double> > theRecHits;
260 
261  try {
262 
264  iEvent.getByToken(tok_ecal_,ec);
265 
266  for(EcalRecHitCollection::const_iterator recHit = (*ec).begin();
267  recHit != (*ec).end(); ++recHit)
268  {
269 // EcalBarrel = 1, EcalEndcap = 2
270 
271  GlobalPoint pos = geo->getPosition(recHit->detid());
272  theRecHits.push_back(std::pair<DetId, double>(recHit->detid(), recHit->energy()));
273 
274  if( (*recHit).energy()> ecut[recHit->detid().subdetId()-1][0] )
275  (*myout_ecal)<<recHit->detid().subdetId()<<" "<<(*recHit).energy()<<" "<<pos.phi()<<" "<<pos.eta()
276  <<" "<<iEvent.id().event()<<endl;
277 
278  }
279 
280  } catch (cms::Exception& e) { // can't find it!
281  if (!allowMissingInputs_) {
282  cout<<" Ecal collection is missed "<<endl;
283  throw e;
284  }
285  }
286 
287  cout<<" Fill EcalRecHits "<<endl;
288 // cout<<" Start to get hbhe "<<endl;
289 // Hcal Barrel and endcap for isolation
290  try {
292  iEvent.getByToken(tok_hbhe_,hbhe);
293 
294 // (*myout_hcal)<<(*hbhe).size()<<endl;
295  for(HBHERecHitCollection::const_iterator hbheItr = (*hbhe).begin();
296 
297  hbheItr != (*hbhe).end(); ++hbheItr)
298  {
299  DetId id = (hbheItr)->detid();
300  GlobalPoint pos = geo->getPosition(hbheItr->detid());
301  (*myout_hcal)<<id.subdetId()<<" "<<(*hbheItr).energy()<<" "<<pos.phi()<<
302  " "<<pos.eta()<<" "<<iEvent.id().event()<<endl;
303  theRecHits.push_back(std::pair<DetId, double>(hbheItr->detid(), hbheItr->energy()));
304 
305  }
306  } catch (cms::Exception& e) { // can't find it!
307  if (!allowMissingInputs_) {
308  cout<<" HBHE collection is missed "<<endl;
309  throw e;
310  }
311  }
312 
313 
314  for(int i = 0; i<9; i++)
315  {
316  for(int j= 0; j<10; j++) GammaIsoEcal[i][j] = 0.;
317  }
318 
319 // Load Ecal clusters
320  jetexist = -100;
321  int barrel = 1;
322  NumRecoGamma = 0;
323 
324  try {
325  int ij = 0;
326  // Get island super clusters after energy correction
328  iEvent.getByToken(tok_egamma_, eclus);
329  const reco::SuperClusterCollection* correctedSuperClusters=eclus.product();
330  // loop over the super clusters and fill the histogram
331  for(reco::SuperClusterCollection::const_iterator aClus = correctedSuperClusters->begin();
332  aClus != correctedSuperClusters->end(); aClus++) {
333  double vet = aClus->energy()/cosh(aClus->eta());
334  cout<<" Supercluster " << ij<<" Et "<< vet <<" energy "<<aClus->energy()<<" eta "<<aClus->eta()<<" Cut "<<CutOnEgammaEnergy_<<endl;
335 
336  if(vet>CutOnEgammaEnergy_) {
337  ij++;
338  float gammaiso_ecal[9] = {0.,0.,0.,0.,0.,0.,0.,0.,0.};
339  for(vector<std::pair<DetId, double> >::const_iterator it = theRecHits.begin(); it != theRecHits.end(); it++)
340  {
341  GlobalPoint pos = geo->getPosition(it->first);
342  double eta = pos.eta();
343  double phi = pos.phi();
344  double deta = fabs(eta-aClus->eta());
345  double dphi = fabs(phi-aClus->phi());
346  if(dphi>4.*atan(1.)) dphi = 8.*atan(1.)-dphi;
347  double dr = sqrt(deta*deta+dphi*dphi);
348 
349  double rmin = 0.07;
350  if( fabs(aClus->eta()) > 1.47 ) rmin = 0.07*(fabs(aClus->eta())-.47)*1.2;
351  if( fabs(aClus->eta()) > 2.2 ) rmin = 0.07*(fabs(aClus->eta())-.47)*1.4;
352 
353  int itype_ecal = 0;
354  double ecutn = 0.;
355  for (int i = 0; i<3; i++)
356  {
357  for (int j = 0; j<3; j++)
358  {
359 
360  if(it->first.det() == DetId::Ecal )
361  {
362  if(it->first.subdetId() == 1) ecutn = ecut[0][j];
363  if(it->first.subdetId() == 2) ecutn = ecut[1][j];
364  if( dr>rmin && dr<risol[i])
365  {
366  if((*it).second > ecutn) gammaiso_ecal[itype_ecal] = gammaiso_ecal[itype_ecal]+(*it).second/cosh(eta);
367  }
368  }
369 
370  if(it->first.det() == DetId::Hcal )
371  {
372  ecutn = ecut[2][j];
373  if( dr>rmin && dr<risol[i])
374  {
375  if((*it).first > ecutn)
376  {
377  gammaiso_ecal[itype_ecal] = gammaiso_ecal[itype_ecal]+(*it).second/cosh(eta);
378  }
379  }
380  }
381  jetexist = ij;
382  itype_ecal++;
383 
384  } // Ecal
385  } // cycle on iso radii
386  } // cycle on rechits
387 
388 
389 // Fill Tree
390  if( NumRecoGamma < 10 )
391  {
392  for (int ii = 0; ii<9 ; ii++)
393  {
394  GammaIsoEcal[ii][NumRecoGamma] = gammaiso_ecal[ii];
395  }
397  GammaRecoEt[NumRecoGamma] = vet;
398  GammaRecoEta[NumRecoGamma] = aClus->eta();
399  GammaRecoPhi[NumRecoGamma] = aClus->phi();
400  NumRecoGamma++;
401  }
402  (*myout_photon)<<ij<<" "<<barrel<<" "<<vet<<" "<<aClus->eta()<<" "<<aClus->phi()<<" "<<iEvent.id().event()<<endl;
403  (*myout_photon)<<ij<<" "<<gammaiso_ecal[0]<<" "<<gammaiso_ecal[1] <<" "<<gammaiso_ecal[2]<<" "<<gammaiso_ecal[3]
404  <<" "<<gammaiso_ecal[4]<<" "<<gammaiso_ecal[5]<<" "<<gammaiso_ecal[6]<<" "<<gammaiso_ecal[7]<<" "<<gammaiso_ecal[8]<<endl;
405 
406  jetexist = ij;
407  } //vet
408  } // number of superclusters
409  } catch (cms::Exception& e) { // can't find it!
410  if (!allowMissingInputs_) {
411  cout<<" Ecal barrel clusters are missed "<<endl;
412  throw e;
413  }
414  }
415 
416  cout<<" After iso cuts "<<jetexist<<endl;
417 
418  double ecluslost = -100.1;
419  if(jetexist<0) (*myout_photon)<<jetexist<<" "<<barrel<<" "<<ecluslost<<" "<<ecluslost
420  <<" "<<ecluslost<<" "<<iEvent.id().event()<<endl;
421 
422  cout<<" Event is ready "<<endl;
423 
424  myTree->Fill();
425 
426 } // analyze method
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Event.cc:83
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::vector< EcalRecHit >::const_iterator const_iterator
T eta() const
int ii
Definition: cuy.py:588
edm::EDGetTokenT< EcalRecHitCollection > tok_ecal_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
T sqrt(T t)
Definition: SSEVec.h:48
vector< PseudoJet > jets
int j
Definition: DBlmapReader.cc:9
std::ofstream * myout_ecal
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
Definition: DetId.h:18
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
T eta() const
Definition: PV3DBase.h:76
edm::EventID id() const
Definition: EventBase.h:56
const CaloGeometry * geo
tuple cout
Definition: gather_cfg.py:121
edm::EDGetTokenT< reco::CaloJetCollection > tok_jets_
edm::EDGetTokenT< reco::SuperClusterCollection > tok_egamma_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
Definition: DDAxes.h:10
void cms::GammaJetAnalysis::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 108 of file GammaJetAnalysis.cc.

References gather_cfg::cout, event(), and DTTTrigCorrFirst::run.

109 {
110  hOutputFile = new TFile( fOutputFileName.c_str(), "RECREATE" ) ;
111  myTree = new TTree("GammaJet","GammaJet Tree");
112  myTree->Branch("run", &run, "run/I");
113  myTree->Branch("event", &event, "event/I");
114 
115  NumRecoJets = 0;
116  NumGenJets = 0;
117  NumRecoGamma = 0;
118  NumRecoTrack = 0;
119  NumPart = 0;
120 // Jet block
121  myTree->Branch("NumRecoJets", &NumRecoJets, "NumRecoJets/I");
122  myTree->Branch("JetRecoEt", JetRecoEt, "JetRecoEt[10]/F");
123  myTree->Branch("JetRecoEta", JetRecoEta, "JetRecoEta[10]/F");
124  myTree->Branch("JetRecoPhi", JetRecoPhi, "JetRecoPhi[10]/F");
125  myTree->Branch("JetRecoType", JetRecoType, "JetRecoType[10]/F");
126 
127 // Gamma block for ECAL isolated gammas
128  myTree->Branch("NumRecoGamma", &NumRecoGamma, "NumRecoGamma/I");
129  myTree->Branch("EcalClusDet", &EcalClusDet, "EcalClusDet[20]/I");
130  myTree->Branch("GammaRecoEt", GammaRecoEt, "GammaRecoEt[20]/F");
131  myTree->Branch("GammaRecoEta", GammaRecoEta, "GammaRecoEta[20]/F");
132  myTree->Branch("GammaRecoPhi", GammaRecoPhi, "GammaRecoPhi[20]/F");
133  myTree->Branch("GammaIsoEcal", GammaIsoEcal, "GammaIsoEcal[9][20]/F");
134 
135 // Tracks block
136  myTree->Branch("NumRecoTrack", &NumRecoTrack, "NumRecoTrack/I");
137  myTree->Branch("TrackRecoEt", TrackRecoEt, "TrackRecoEt[200]/F");
138  myTree->Branch("TrackRecoEta", TrackRecoEta, "TrackRecoEta[200]/F");
139  myTree->Branch("TrackRecoPhi", TrackRecoPhi, "TrackRecoPhi[200]/F");
140 
141 // end of tree declaration
142 
143 // edm::ESHandle<CaloGeometry> pG;
144 // iSetup.get<CaloGeometryRecord>().get(pG);
145 // geo = pG.product();
146 
147  myout_part = new std::ofstream((myName+"_part.dat").c_str());
148  if(!myout_part) cout << " Output file not open!!! "<<endl;
149  myout_hcal = new std::ofstream((myName+"_hcal.dat").c_str());
150  if(!myout_hcal) cout << " Output file not open!!! "<<endl;
151  myout_ecal = new std::ofstream((myName+"_ecal.dat").c_str());
152  if(!myout_ecal) cout << " Output file not open!!! "<<endl;
153 
154  myout_jet = new std::ofstream((myName+"_jet.dat").c_str());
155  if(!myout_jet) cout << " Output file not open!!! "<<endl;
156  myout_photon = new std::ofstream((myName+"_photon.dat").c_str());
157  if(!myout_photon) cout << " Output file not open!!! "<<endl;
158 
159 
160 }
std::ofstream * myout_jet
std::ofstream * myout_hcal
std::ofstream * myout_photon
std::ofstream * myout_part
std::ofstream * myout_ecal
tuple cout
Definition: gather_cfg.py:121
void cms::GammaJetAnalysis::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 162 of file GammaJetAnalysis.cc.

References gather_cfg::cout.

163 {
164 
165  cout << "===== Start writing user histograms =====" << endl;
166  hOutputFile->SetCompressionLevel(2);
167  hOutputFile->cd();
168  myTree->Write();
169  hOutputFile->Close() ;
170  cout << "===== End writing user histograms =======" << endl;
171 }
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

bool cms::GammaJetAnalysis::allowMissingInputs_
private

Definition at line 85 of file GammaJetAnalysis.h.

int cms::GammaJetAnalysis::Code[4000]
private

Definition at line 104 of file GammaJetAnalysis.h.

double cms::GammaJetAnalysis::CutOnEgammaEnergy_
private

Definition at line 73 of file GammaJetAnalysis.h.

int cms::GammaJetAnalysis::EcalClusDet[20]
private

Definition at line 101 of file GammaJetAnalysis.h.

std::string cms::GammaJetAnalysis::ecalInput_
private

Definition at line 67 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::ecut[3][3]
private

Definition at line 108 of file GammaJetAnalysis.h.

int cms::GammaJetAnalysis::event
private

Definition at line 97 of file GammaJetAnalysis.h.

Referenced by Types.EventID::cppID().

std::string cms::GammaJetAnalysis::fOutputFileName
private

Definition at line 84 of file GammaJetAnalysis.h.

std::string cms::GammaJetAnalysis::gammaClus_
private

Definition at line 66 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::GammaIsoEcal[9][20]
private

Definition at line 102 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::GammaIsoHcal[9][20]
private

Definition at line 102 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::GammaRecoEt[20]
private

Definition at line 102 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::GammaRecoEta[20]
private

Definition at line 102 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::GammaRecoPhi[20]
private

Definition at line 102 of file GammaJetAnalysis.h.

const CaloGeometry* cms::GammaJetAnalysis::geo
private

Definition at line 111 of file GammaJetAnalysis.h.

std::string cms::GammaJetAnalysis::hbheInput_
private

Definition at line 68 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::HcalDet[8000]
private

Definition at line 103 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::HcalRecoEt[8000]
private

Definition at line 103 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::HcalRecoEta[8000]
private

Definition at line 103 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::HcalRecoPhi[8000]
private

Definition at line 103 of file GammaJetAnalysis.h.

std::string cms::GammaJetAnalysis::hfInput_
private

Definition at line 70 of file GammaJetAnalysis.h.

std::string cms::GammaJetAnalysis::hoInput_
private

Definition at line 69 of file GammaJetAnalysis.h.

TFile* cms::GammaJetAnalysis::hOutputFile
private

Definition at line 88 of file GammaJetAnalysis.h.

std::string cms::GammaJetAnalysis::jetCalo_
private

Definition at line 65 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::JetGenEt[10]
private

Definition at line 99 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::JetGenEta[10]
private

Definition at line 99 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::JetGenPhi[10]
private

Definition at line 99 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::JetGenType[10]
private

Definition at line 99 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::JetRecoEt[10]
private

Definition at line 98 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::JetRecoEta[10]
private

Definition at line 98 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::JetRecoPhi[10]
private

Definition at line 98 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::JetRecoType[10]
private

Definition at line 98 of file GammaJetAnalysis.h.

int cms::GammaJetAnalysis::Mother1[4000]
private

Definition at line 104 of file GammaJetAnalysis.h.

std::string cms::GammaJetAnalysis::myName
private

Definition at line 72 of file GammaJetAnalysis.h.

std::ofstream* cms::GammaJetAnalysis::myout_ecal
private

Definition at line 92 of file GammaJetAnalysis.h.

std::ofstream* cms::GammaJetAnalysis::myout_hcal
private

Definition at line 91 of file GammaJetAnalysis.h.

std::ofstream* cms::GammaJetAnalysis::myout_jet
private

Definition at line 93 of file GammaJetAnalysis.h.

std::ofstream* cms::GammaJetAnalysis::myout_part
private

Definition at line 90 of file GammaJetAnalysis.h.

std::ofstream* cms::GammaJetAnalysis::myout_photon
private

Definition at line 94 of file GammaJetAnalysis.h.

TTree* cms::GammaJetAnalysis::myTree
private

Definition at line 89 of file GammaJetAnalysis.h.

std::string cms::GammaJetAnalysis::nameProd_
private

Definition at line 64 of file GammaJetAnalysis.h.

int cms::GammaJetAnalysis::NumGenJets
private

Definition at line 96 of file GammaJetAnalysis.h.

int cms::GammaJetAnalysis::NumPart
private

Definition at line 96 of file GammaJetAnalysis.h.

int cms::GammaJetAnalysis::NumRecoGamma
private

Definition at line 96 of file GammaJetAnalysis.h.

int cms::GammaJetAnalysis::NumRecoHcal
private

Definition at line 96 of file GammaJetAnalysis.h.

int cms::GammaJetAnalysis::NumRecoJets
private

Definition at line 96 of file GammaJetAnalysis.h.

int cms::GammaJetAnalysis::NumRecoTrack
private

Definition at line 96 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::parte[4000]
private

Definition at line 105 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::partm[4000]
private

Definition at line 105 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::partpx[4000]
private

Definition at line 105 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::partpy[4000]
private

Definition at line 105 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::partpz[4000]
private

Definition at line 105 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::partvt[4000]
private

Definition at line 106 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::partvx[4000]
private

Definition at line 105 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::partvy[4000]
private

Definition at line 106 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::partvz[4000]
private

Definition at line 106 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::risol[3]
private

Definition at line 107 of file GammaJetAnalysis.h.

int cms::GammaJetAnalysis::run
private
int cms::GammaJetAnalysis::Status[4000]
private

Definition at line 104 of file GammaJetAnalysis.h.

edm::EDGetTokenT<EcalRecHitCollection> cms::GammaJetAnalysis::tok_ecal_
private

Definition at line 77 of file GammaJetAnalysis.h.

edm::EDGetTokenT<reco::SuperClusterCollection> cms::GammaJetAnalysis::tok_egamma_
private

Definition at line 76 of file GammaJetAnalysis.h.

edm::EDGetTokenT<HBHERecHitCollection> cms::GammaJetAnalysis::tok_hbhe_
private

Definition at line 78 of file GammaJetAnalysis.h.

edm::EDGetTokenT<HFRecHitCollection> cms::GammaJetAnalysis::tok_hf_
private

Definition at line 80 of file GammaJetAnalysis.h.

edm::EDGetTokenT<HORecHitCollection> cms::GammaJetAnalysis::tok_ho_
private

Definition at line 79 of file GammaJetAnalysis.h.

edm::EDGetTokenT<reco::CaloJetCollection> cms::GammaJetAnalysis::tok_jets_
private

Definition at line 75 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::TrackRecoEt[10]
private

Definition at line 100 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::TrackRecoEta[10]
private

Definition at line 100 of file GammaJetAnalysis.h.

float cms::GammaJetAnalysis::TrackRecoPhi[10]
private

Definition at line 100 of file GammaJetAnalysis.h.

std::string cms::GammaJetAnalysis::Tracks_
private

Definition at line 71 of file GammaJetAnalysis.h.

bool cms::GammaJetAnalysis::useMC
private

Definition at line 86 of file GammaJetAnalysis.h.