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 Member Functions | Private Attributes | Static Private Attributes
IsolatedTracksHcalScale Class Reference

#include <IsolatedTracksHcalScale.h>

Inheritance diagram for IsolatedTracksHcalScale:
edm::EDAnalyzer

Public Member Functions

 IsolatedTracksHcalScale (const edm::ParameterSet &)
 
 ~IsolatedTracksHcalScale ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
void beginJob ()
 
void clearTreeVectors ()
 
void endJob ()
 

Private Attributes

double a_charIsoR
 
double a_coneR
 
double a_mipR
 
double a_neutIsoR
 
const MagneticFieldbField
 
bool doMC
 
edm::Service< TFileServicefs
 
double genPartEtaBins [4]
 
bool initL1
 
std::string minQuality
 
int myverbose
 
int nEventProc
 
spr::trackSelectionParameters selectionParameters
 
int t_Bunch
 
std::vector< double > * t_conehmaxNearP
 
std::vector< double > * t_e11x11_20Sig
 
std::vector< double > * t_e15x15_20Sig
 
std::vector< double > * t_eECALDR
 
std::vector< double > * t_eHCALDR
 
std::vector< double > * t_eMipDR
 
int t_EvtNo
 
std::vector< double > * t_hCone
 
std::vector< double > * t_hsim
 
std::vector< double > * t_hsimInfoCharHad
 
std::vector< double > * t_hsimInfoMatched
 
std::vector< int > * t_hsimInfoNCharHad
 
std::vector< double > * t_hsimInfoNeutHad
 
std::vector< int > * t_hsimInfoNMatched
 
std::vector< int > * t_hsimInfoNNeutHad
 
std::vector< int > * t_hsimInfoNPhoton
 
std::vector< int > * t_hsimInfoNRest
 
std::vector< int > * t_hsimInfoNTotal
 
std::vector< double > * t_hsimInfoPdgMatched
 
std::vector< double > * t_hsimInfoPhoton
 
std::vector< double > * t_hsimInfoRest
 
std::vector< double > * t_hsimInfoTotal
 
int t_Lumi
 
std::vector< int > * t_nSimHits
 
int t_nTracks
 
int t_RunNo
 
std::vector< double > * t_trackEta
 
std::vector< double > * t_trackHcalEta
 
std::vector< double > * t_trackHcalPhi
 
std::vector< double > * t_trackP
 
std::vector< double > * t_trackPhi
 
std::vector< double > * t_trackPt
 
std::string theTrackQuality
 
double tMaxE_
 
double tMinE_
 
TTree * tree
 

Static Private Attributes

static const size_t NEtaBins = 3
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 112 of file IsolatedTracksHcalScale.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file IsolatedTracksHcalScale.cc.

References a_charIsoR, a_coneR, a_mipR, a_neutIsoR, gather_cfg::cout, doMC, edm::ParameterSet::getUntrackedParameter(), initL1, 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, myverbose, reco::TrackBase::qualityByName(), selectionParameters, theTrackQuality, tMaxE_, and tMinE_.

16  {
17 
18  //now do what ever initialization is needed
19  doMC = iConfig.getUntrackedParameter<bool>("DoMC", false);
20  myverbose = iConfig.getUntrackedParameter<int>("Verbosity", 5 );
21  theTrackQuality = iConfig.getUntrackedParameter<std::string>("TrackQuality","highPurity");
23  selectionParameters.minPt = iConfig.getUntrackedParameter<double>("MinTrackPt", 10.0);
24  selectionParameters.minQuality = trackQuality_;
25  selectionParameters.maxDxyPV = iConfig.getUntrackedParameter<double>("MaxDxyPV", 0.2);
26  selectionParameters.maxDzPV = iConfig.getUntrackedParameter<double>("MaxDzPV", 5.0);
27  selectionParameters.maxChi2 = iConfig.getUntrackedParameter<double>("MaxChi2", 5.0);
28  selectionParameters.maxDpOverP = iConfig.getUntrackedParameter<double>("MaxDpOverP", 0.1);
29  selectionParameters.minOuterHit = iConfig.getUntrackedParameter<int>("MinOuterHit", 4);
30  selectionParameters.minLayerCrossed = iConfig.getUntrackedParameter<int>("MinLayerCrossed", 8);
31  selectionParameters.maxInMiss = iConfig.getUntrackedParameter<int>("MaxInMiss", 0);
32  selectionParameters.maxOutMiss = iConfig.getUntrackedParameter<int>("MaxOutMiss", 0);
33  a_coneR = iConfig.getUntrackedParameter<double>("ConeRadius",34.98);
34  a_charIsoR = a_coneR + 28.9;
35  a_neutIsoR = a_charIsoR*0.726;
36  a_mipR = iConfig.getUntrackedParameter<double>("ConeRadiusMIP",14.0);
37  tMinE_ = iConfig.getUntrackedParameter<double>("TimeMinCutECAL", -500.);
38  tMaxE_ = iConfig.getUntrackedParameter<double>("TimeMaxCutECAL", 500.);
39 
40  if (myverbose>=0) {
41  std::cout <<"Parameters read from config file \n"
42  <<" doMC " << doMC
43  <<"\t myverbose " << myverbose
44  <<"\t minPt " << selectionParameters.minPt
45  <<"\t theTrackQuality " << theTrackQuality
46  <<"\t minQuality " << selectionParameters.minQuality
47  <<"\t maxDxyPV " << selectionParameters.maxDxyPV
48  <<"\t maxDzPV " << selectionParameters.maxDzPV
49  <<"\t maxChi2 " << selectionParameters.maxChi2
50  <<"\t maxDpOverP " << selectionParameters.maxDpOverP
51  <<"\t minOuterHit " << selectionParameters.minOuterHit
52  <<"\t minLayerCrossed " << selectionParameters.minLayerCrossed
53  <<"\t maxInMiss " << selectionParameters.maxInMiss
54  <<"\t maxOutMiss " << selectionParameters.maxOutMiss
55  <<"\t a_coneR " << a_coneR
56  <<"\t a_charIsoR " << a_charIsoR
57  <<"\t a_neutIsoR " << a_neutIsoR
58  <<"\t a_mipR " << a_mipR
59  <<"\t time Range (" << tMinE_ << ":" << tMaxE_ << ")"
60  << std::endl;
61  }
62  initL1 = false;
63 
64 }
T getUntrackedParameter(std::string const &, T const &) const
TrackQuality
track quality
Definition: TrackBase.h:95
spr::trackSelectionParameters selectionParameters
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:46
reco::TrackBase::TrackQuality minQuality
tuple cout
Definition: gather_cfg.py:41
IsolatedTracksHcalScale::~IsolatedTracksHcalScale ( )

Definition at line 66 of file IsolatedTracksHcalScale.cc.

66 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 68 of file IsolatedTracksHcalScale.cc.

References a_charIsoR, a_coneR, a_mipR, a_neutIsoR, bField, edm::EventBase::bunchCrossing(), spr::chargeIsolationCone(), clearTreeVectors(), gather_cfg::cout, doMC, spr::eCone_ecal(), spr::eCone_hcal(), spr::eECALmatrix(), edm::EventID::event(), edm::EventSetup::get(), edm::Event::getByLabel(), spr::goodTrack(), edm::EventBase::id(), HcalDetId::ieta(), HcalDetId::iphi(), edm::HandleBase::isValid(), edm::EventBase::luminosityBlock(), reco::TrackBase::momentum(), myverbose, nEventProc, reco::TrackBase::p(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), spr::propagateCALO(), reco::TrackBase::pt(), edm::EventID::run(), selectionParameters, t_Bunch, t_conehmaxNearP, t_e11x11_20Sig, t_e15x15_20Sig, t_eECALDR, t_eHCALDR, t_eMipDR, t_EvtNo, t_hCone, t_hsim, t_hsimInfoCharHad, t_hsimInfoMatched, t_hsimInfoNCharHad, t_hsimInfoNeutHad, t_hsimInfoNMatched, t_hsimInfoNNeutHad, t_hsimInfoNPhoton, t_hsimInfoNRest, t_hsimInfoNTotal, t_hsimInfoPdgMatched, t_hsimInfoPhoton, t_hsimInfoRest, t_hsimInfoTotal, t_Lumi, t_nSimHits, t_RunNo, t_trackEta, t_trackHcalEta, t_trackHcalPhi, t_trackP, t_trackPhi, t_trackPt, theTrackQuality, tMaxE_, tMinE_, tree, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

68  {
69 
71  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
72  bField = bFieldH.product();
73 
74  // get handles to calogeometry and calotopology
76  iSetup.get<CaloGeometryRecord>().get(pG);
77  const CaloGeometry* geo = pG.product();
78 
79  edm::ESHandle<CaloTopology> theCaloTopology;
80  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
81  const CaloTopology *caloTopology = theCaloTopology.product();
82 
83  /*
84  edm::ESHandle<HcalTopology> htopo;
85  iSetup.get<IdealGeometryRecord>().get(htopo);
86  const HcalTopology* theHBHETopology = htopo.product();
87  */
88 
89  // Retrieve the good/bad ECAL channels from the DB
91  iSetup.get<EcalChannelStatusRcd>().get(ecalChStatus);
92  const EcalChannelStatus* theEcalChStatus = ecalChStatus.product();
93 
94  /*
95  // Retrieve trigger tower map
96  edm::ESHandle<EcalTrigTowerConstituentsMap> hTtmap;
97  iSetup.get<IdealGeometryRecord>().get(hTtmap);
98  const EcalTrigTowerConstituentsMap& ttMap = *hTtmap;
99  */
100 
102 
103  nEventProc++;
104 
105  t_RunNo = iEvent.id().run();
106  t_EvtNo = iEvent.id().event();
107  t_Lumi = iEvent.luminosityBlock();
108  t_Bunch = iEvent.bunchCrossing();
109  if (myverbose>0) std::cout << nEventProc << " Run " << t_RunNo << " Event " << t_EvtNo << " Lumi " << t_Lumi << " Bunch " << t_Bunch << std::endl;
110 
112  iEvent.getByLabel("generalTracks", trkCollection);
113 
115  iEvent.getByLabel("offlinePrimaryVertices",recVtxs);
116 
117  // Get the beamspot
118  edm::Handle<reco::BeamSpot> beamSpotH;
119  iEvent.getByLabel("offlineBeamSpot", beamSpotH);
120 
121  math::XYZPoint leadPV(0,0,0);
122  if (recVtxs->size()>0 && !((*recVtxs)[0].isFake())) {
123  leadPV = math::XYZPoint( (*recVtxs)[0].x(),(*recVtxs)[0].y(), (*recVtxs)[0].z() );
124  } else if (beamSpotH.isValid()) {
125  leadPV = beamSpotH->position();
126  }
127 
128  if (myverbose>0) {
129  std::cout << "Primary Vertex " << leadPV;
130  if (beamSpotH.isValid()) std::cout << " Beam Spot " << beamSpotH->position();
131  std::cout << std::endl;
132  }
133 
134  std::vector<spr::propagatedTrackDirection> trkCaloDirections;
135  spr::propagateCALO(trkCollection, geo, bField, theTrackQuality, trkCaloDirections, (myverbose>2));
136  std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
137 
138  edm::Handle<EcalRecHitCollection> barrelRecHitsHandle;
139  edm::Handle<EcalRecHitCollection> endcapRecHitsHandle;
140  iEvent.getByLabel("ecalRecHit","EcalRecHitsEB",barrelRecHitsHandle);
141  iEvent.getByLabel("ecalRecHit","EcalRecHitsEE",endcapRecHitsHandle);
142 
144  iEvent.getByLabel("hbhereco",hbhe);
145  const HBHERecHitCollection Hithbhe = *(hbhe.product());
146 
147  //get Handles to SimTracks and SimHits
149  edm::SimTrackContainer::const_iterator simTrkItr;
151  edm::SimVertexContainer::const_iterator vtxItr = SimVtx->begin();
152 
153  //get Handles to PCaloHitContainers of eb/ee/hbhe
157 
158  //associates tracker rechits/simhits to a track
159  TrackerHitAssociator* associate=0;
160 
161  if (doMC) {
162  iEvent.getByLabel("g4SimHits",SimTk);
163  iEvent.getByLabel("g4SimHits",SimVtx);
164  iEvent.getByLabel("g4SimHits", "EcalHitsEB", pcaloeb);
165  iEvent.getByLabel("g4SimHits", "EcalHitsEE", pcaloee);
166  iEvent.getByLabel("g4SimHits", "HcalHits", pcalohh);
167  associate = new TrackerHitAssociator(iEvent);
168  }
169 
170  unsigned int nTracks=0;
171  for (trkDetItr = trkCaloDirections.begin(),nTracks=0; trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++){
172  const reco::Track* pTrack = &(*(trkDetItr->trkItr));
173  if (spr::goodTrack(pTrack,leadPV,selectionParameters,(myverbose>2)) && trkDetItr->okECAL && trkDetItr->okHCAL) {
174  int nRH_eMipDR=0, nRH_eDR=0, nNearTRKs=0, nRecHitsCone=-99;
175  double distFromHotCell=-99.0, distFromHotCell2=-99.0;
176  int ietaHotCell=-99, iphiHotCell=-99;
177  int ietaHotCell2=-99, iphiHotCell2=-99;
178  GlobalPoint gposHotCell(0.,0.,0.), gposHotCell2(0.,0.,0.);
179  std::vector<DetId> coneRecHitDetIds, coneRecHitDetIds2;
180  std::pair<double, bool> e11x11_20SigP, e15x15_20SigP;
181  double hCone = spr::eCone_hcal(geo, hbhe, trkDetItr->pointHCAL, trkDetItr->pointECAL,
182  a_coneR, trkDetItr->directionHCAL, nRecHitsCone,
183  coneRecHitDetIds, distFromHotCell,
184  ietaHotCell, iphiHotCell, gposHotCell);
185  double eHCALDR = spr::eCone_hcal(geo, hbhe, trkDetItr->pointHCAL, trkDetItr->pointECAL,
186  a_charIsoR, trkDetItr->directionHCAL, nRecHitsCone,
187  coneRecHitDetIds2, distFromHotCell2,
188  ietaHotCell2, iphiHotCell2, gposHotCell2);
189 
190  double conehmaxNearP = spr::chargeIsolationCone(nTracks, trkCaloDirections, a_charIsoR, nNearTRKs, (myverbose>3));
191 
192  double eMipDR = spr::eCone_ecal(geo, barrelRecHitsHandle, endcapRecHitsHandle,
193  trkDetItr->pointHCAL, trkDetItr->pointECAL,
194  a_mipR, trkDetItr->directionECAL, nRH_eMipDR);
195  double eECALDR = spr::eCone_ecal(geo, barrelRecHitsHandle, endcapRecHitsHandle,
196  trkDetItr->pointHCAL, trkDetItr->pointECAL,
197  a_neutIsoR, trkDetItr->directionECAL, nRH_eDR);
198 
199  HcalDetId closestCell = (HcalDetId)(trkDetItr->detIdHCAL);
200 
202  iSetup.get<EcalSeverityLevelAlgoRcd>().get(sevlv);
203 
204  e11x11_20SigP = spr::eECALmatrix(trkDetItr->detIdECAL,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),5,5, 0.060, 0.300, tMinE_,tMaxE_);
205  e15x15_20SigP = spr::eECALmatrix(trkDetItr->detIdECAL,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.product(),7,7, 0.060, 0.300, tMinE_,tMaxE_);
206 
207  // Fill the tree Branches here
208  t_trackP ->push_back( pTrack->p() );
209  t_trackPt ->push_back( pTrack->pt() );
210  t_trackEta ->push_back( pTrack->momentum().eta() );
211  t_trackPhi ->push_back( pTrack->momentum().phi() );
212  t_trackHcalEta ->push_back( closestCell.ieta() );
213  t_trackHcalPhi ->push_back( closestCell.iphi() );
214  t_hCone ->push_back( hCone);
215  t_conehmaxNearP ->push_back( conehmaxNearP);
216  t_eMipDR ->push_back( eMipDR);
217  t_eECALDR ->push_back( eECALDR);
218  t_eHCALDR ->push_back( eHCALDR);
219  t_e11x11_20Sig ->push_back( e11x11_20SigP.first );
220  t_e15x15_20Sig ->push_back( e15x15_20SigP.first );
221 
222  if (myverbose > 0) {
223  std::cout << "Track p " << pTrack->p() << " pt " << pTrack->pt()
224  << " eta " << pTrack->momentum().eta() << " phi "
225  << pTrack->momentum().phi() << " ieta/iphi ("
226  << closestCell.ieta() << ", " << closestCell.iphi()
227  << ") Energy in cone " << hCone << " Charge Isolation "
228  << conehmaxNearP << " eMIP " << eMipDR
229  << " Neutral isolation (ECAL) " << eECALDR-eMipDR
230  << " (ECAL NxN) " << e15x15_20SigP.first-e11x11_20SigP.first
231  << " (HCAL) " << eHCALDR-hCone << std::endl;
232  }
233 
234  if (doMC) {
235  int nSimHits = -999;
236  double hsim;
237  std::map<std::string, double> hsimInfo;
238  std::vector<int> multiplicity;
239  hsim = spr::eCone_hcal(geo, pcalohh, trkDetItr->pointHCAL,
240  trkDetItr->pointECAL, a_coneR,
241  trkDetItr->directionHCAL, nSimHits);
242  hsimInfo = spr::eHCALSimInfoCone(iEvent, pcalohh, SimTk, SimVtx,
243  pTrack, *associate, geo,
244  trkDetItr->pointHCAL,
245  trkDetItr->pointECAL, a_coneR,
246  trkDetItr->directionHCAL,
247  multiplicity);
248 
249  t_hsimInfoMatched ->push_back(hsimInfo["eMatched" ]);
250  t_hsimInfoRest ->push_back(hsimInfo["eRest" ]);
251  t_hsimInfoPhoton ->push_back(hsimInfo["eGamma" ]);
252  t_hsimInfoNeutHad ->push_back(hsimInfo["eNeutralHad"]);
253  t_hsimInfoCharHad ->push_back(hsimInfo["eChargedHad"]);
254  t_hsimInfoPdgMatched->push_back(hsimInfo["pdgMatched" ]);
255  t_hsimInfoTotal ->push_back(hsimInfo["eTotal" ]);
256 
257  t_hsimInfoNMatched ->push_back(multiplicity.at(0));
258  t_hsimInfoNTotal ->push_back(multiplicity.at(1));
259  t_hsimInfoNNeutHad ->push_back(multiplicity.at(2));
260  t_hsimInfoNCharHad ->push_back(multiplicity.at(3));
261  t_hsimInfoNPhoton ->push_back(multiplicity.at(4));
262  t_hsimInfoNRest ->push_back(multiplicity.at(5));
263 
264  t_hsim ->push_back(hsim );
265  t_nSimHits ->push_back(nSimHits );
266 
267  if (myverbose > 0) {
268  std::cout << "Matched (E) " << hsimInfo["eMatched"] << " (N) "
269  << multiplicity.at(0) << " Rest (E) " << hsimInfo["eRest"]
270  << " (N) " << multiplicity.at(1) << " Gamma (E) "
271  << hsimInfo["eGamma"] << " (N) " << multiplicity.at(2)
272  << " Neutral Had (E) " << hsimInfo["eNeutralHad"]
273  << " (N) " << multiplicity.at(3) << " Charged Had (E) "
274  << hsimInfo["eChargedHad"] << " (N) " << multiplicity.at(4)
275  << " Total (E) " << hsimInfo["eTotal"] << " (N) "
276  << multiplicity.at(5) << " PDG " << hsimInfo["pdgMatched"]
277  << " Total E " << hsim << " NHit " << nSimHits <<std::endl;
278  }
279  }
280  }
281  }
282 
283  // delete associate;
284  if (associate) delete associate;
285  tree->Fill();
286 }
RunNumber_t run() const
Definition: EventID.h:42
double p() const
momentum vector magnitude
Definition: TrackBase.h:129
std::vector< double > * t_hsimInfoMatched
EventNumber_t event() const
Definition: EventID.h:44
std::vector< double > * t_eHCALDR
std::vector< int > * t_hsimInfoNRest
std::vector< double > * t_hCone
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:150
std::vector< int > * t_hsimInfoNTotal
std::vector< int > * t_hsimInfoNCharHad
std::vector< int > * t_hsimInfoNMatched
std::vector< double > * t_hsim
int bunchCrossing() const
Definition: EventBase.h:62
std::vector< double > * t_hsimInfoNeutHad
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
std::vector< int > * t_hsimInfoNPhoton
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
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 double double z
std::vector< double > * t_e11x11_20Sig
std::vector< int > * t_hsimInfoNNeutHad
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
double pt() const
track transverse momentum
Definition: TrackBase.h:131
std::vector< double > * t_trackEta
int ieta() const
get the cell ieta
Definition: HcalDetId.h:38
std::vector< double > * t_eECALDR
spr::trackSelectionParameters selectionParameters
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
int iphi() const
get the cell iphi
Definition: HcalDetId.h:40
std::vector< double > * t_trackPt
const MagneticField * bField
std::vector< double > * t_trackHcalEta
std::vector< double > * t_trackP
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
const T & get() const
Definition: EventSetup.h:55
std::vector< double > * t_trackHcalPhi
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:74
std::vector< double > * t_hsimInfoPhoton
std::vector< double > * t_hsimInfoTotal
edm::EventID id() const
Definition: EventBase.h:56
std::vector< double > * t_hsimInfoCharHad
std::vector< double > * t_trackPhi
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, const EcalSeverityLevelAlgo *sevlv, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
double eCone_hcal(const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits)
tuple cout
Definition: gather_cfg.py:41
std::vector< double > * t_hsimInfoPdgMatched
Definition: DDAxes.h:10
std::vector< int > * t_nSimHits
std::vector< double > * t_hsimInfoRest
std::vector< double > * t_conehmaxNearP
std::vector< double > * t_e15x15_20Sig
std::vector< double > * t_eMipDR
void IsolatedTracksHcalScale::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 288 of file IsolatedTracksHcalScale.cc.

References doMC, fs, TFileDirectory::make(), nEventProc, t_Bunch, t_conehmaxNearP, t_e11x11_20Sig, t_e15x15_20Sig, t_eECALDR, t_eHCALDR, t_eMipDR, t_hCone, t_hsim, t_hsimInfoCharHad, t_hsimInfoMatched, t_hsimInfoNCharHad, t_hsimInfoNeutHad, t_hsimInfoNMatched, t_hsimInfoNNeutHad, t_hsimInfoNPhoton, t_hsimInfoNRest, t_hsimInfoNTotal, t_hsimInfoPdgMatched, t_hsimInfoPhoton, t_hsimInfoRest, t_hsimInfoTotal, t_Lumi, t_nSimHits, t_RunNo, t_trackEta, t_trackHcalEta, t_trackHcalPhi, t_trackP, t_trackPhi, t_trackPt, and tree.

288  {
289 
290  nEventProc=0;
291 
292 
294  tree = fs->make<TTree>("tree", "tree");
295  tree->SetAutoSave(10000);
296 
297  tree->Branch("t_RunNo" ,&t_RunNo ,"t_RunNo/I");
298  tree->Branch("t_Lumi" ,&t_Lumi ,"t_Lumi/I");
299  tree->Branch("t_Bunch" ,&t_Bunch ,"t_Bunch/I");
300 
301  t_trackP = new std::vector<double>();
302  t_trackPt = new std::vector<double>();
303  t_trackEta = new std::vector<double>();
304  t_trackPhi = new std::vector<double>();
305  t_trackHcalEta = new std::vector<double>();
306  t_trackHcalPhi = new std::vector<double>();
307  t_hCone = new std::vector<double>();
308  t_conehmaxNearP = new std::vector<double>();
309  t_eMipDR = new std::vector<double>();
310  t_eECALDR = new std::vector<double>();
311  t_eHCALDR = new std::vector<double>();
312  t_e11x11_20Sig = new std::vector<double>();
313  t_e15x15_20Sig = new std::vector<double>();
314 
315  tree->Branch("t_trackP", "vector<double>", &t_trackP );
316  tree->Branch("t_trackPt", "vector<double>", &t_trackPt );
317  tree->Branch("t_trackEta", "vector<double>", &t_trackEta );
318  tree->Branch("t_trackPhi", "vector<double>", &t_trackPhi );
319  tree->Branch("t_trackHcalEta", "vector<double>", &t_trackHcalEta );
320  tree->Branch("t_trackHcalPhi", "vector<double>", &t_trackHcalPhi );
321  tree->Branch("t_hCone", "vector<double>", &t_hCone );
322  tree->Branch("t_conehmaxNearP", "vector<double>", &t_conehmaxNearP );
323  tree->Branch("t_eMipDR", "vector<double>", &t_eMipDR );
324  tree->Branch("t_eECALDR", "vector<double>", &t_eECALDR );
325  tree->Branch("t_eHCALDR", "vector<double>", &t_eHCALDR );
326  tree->Branch("t_e11x11_20Sig", "vector<double>", &t_e11x11_20Sig );
327  tree->Branch("t_e15x15_20Sig", "vector<double>", &t_e15x15_20Sig );
328 
329  if (doMC) {
330  t_hsimInfoMatched = new std::vector<double>();
331  t_hsimInfoRest = new std::vector<double>();
332  t_hsimInfoPhoton = new std::vector<double>();
333  t_hsimInfoNeutHad = new std::vector<double>();
334  t_hsimInfoCharHad = new std::vector<double>();
335  t_hsimInfoPdgMatched = new std::vector<double>();
336  t_hsimInfoTotal = new std::vector<double>();
337  t_hsimInfoNMatched = new std::vector<int>();
338  t_hsimInfoNTotal = new std::vector<int>();
339  t_hsimInfoNNeutHad = new std::vector<int>();
340  t_hsimInfoNCharHad = new std::vector<int>();
341  t_hsimInfoNPhoton = new std::vector<int>();
342  t_hsimInfoNRest = new std::vector<int>();
343  t_hsim = new std::vector<double>();
344  t_nSimHits = new std::vector<int>();
345 
346  tree->Branch("t_hsimInfoMatched", "vector<double>", &t_hsimInfoMatched );
347  tree->Branch("t_hsimInfoRest", "vector<double>", &t_hsimInfoRest );
348  tree->Branch("t_hsimInfoPhoton", "vector<double>", &t_hsimInfoPhoton );
349  tree->Branch("t_hsimInfoNeutHad", "vector<double>", &t_hsimInfoNeutHad );
350  tree->Branch("t_hsimInfoCharHad", "vector<double>", &t_hsimInfoCharHad );
351  tree->Branch("t_hsimInfoPdgMatched", "vector<double>", &t_hsimInfoPdgMatched );
352  tree->Branch("t_hsimInfoTotal", "vector<double>", &t_hsimInfoTotal );
353  tree->Branch("t_hsimInfoNMatched", "vector<int>", &t_hsimInfoNMatched );
354  tree->Branch("t_hsimInfoNTotal", "vector<int>", &t_hsimInfoNTotal );
355  tree->Branch("t_hsimInfoNNeutHad", "vector<int>", &t_hsimInfoNNeutHad );
356  tree->Branch("t_hsimInfoNCharHad", "vector<int>", &t_hsimInfoNCharHad );
357  tree->Branch("t_hsimInfoNPhoton", "vector<int>", &t_hsimInfoNPhoton );
358  tree->Branch("t_hsimInfoNRest", "vector<int>", &t_hsimInfoNRest );
359  tree->Branch("t_hsim", "vector<double>", &t_hsim );
360  tree->Branch("t_nSimHits", "vector<int>", &t_nSimHits );
361  }
362 }
std::vector< double > * t_hsimInfoMatched
edm::Service< TFileService > fs
std::vector< double > * t_eHCALDR
std::vector< int > * t_hsimInfoNRest
std::vector< double > * t_hCone
std::vector< int > * t_hsimInfoNTotal
std::vector< int > * t_hsimInfoNCharHad
std::vector< int > * t_hsimInfoNMatched
std::vector< double > * t_hsim
std::vector< double > * t_hsimInfoNeutHad
std::vector< int > * t_hsimInfoNPhoton
std::vector< double > * t_e11x11_20Sig
std::vector< int > * t_hsimInfoNNeutHad
std::vector< double > * t_trackEta
std::vector< double > * t_eECALDR
std::vector< double > * t_trackPt
std::vector< double > * t_trackHcalEta
std::vector< double > * t_trackP
std::vector< double > * t_trackHcalPhi
std::vector< double > * t_hsimInfoPhoton
std::vector< double > * t_hsimInfoTotal
std::vector< double > * t_hsimInfoCharHad
std::vector< double > * t_trackPhi
T * make() const
make new ROOT object
std::vector< double > * t_hsimInfoPdgMatched
std::vector< int > * t_nSimHits
std::vector< double > * t_hsimInfoRest
std::vector< double > * t_conehmaxNearP
std::vector< double > * t_e15x15_20Sig
std::vector< double > * t_eMipDR
void IsolatedTracksHcalScale::clearTreeVectors ( )
private

Definition at line 369 of file IsolatedTracksHcalScale.cc.

References doMC, t_conehmaxNearP, t_e11x11_20Sig, t_e15x15_20Sig, t_eECALDR, t_eHCALDR, t_eMipDR, t_hCone, t_hsim, t_hsimInfoCharHad, t_hsimInfoMatched, t_hsimInfoNCharHad, t_hsimInfoNeutHad, t_hsimInfoNMatched, t_hsimInfoNNeutHad, t_hsimInfoNPhoton, t_hsimInfoNRest, t_hsimInfoNTotal, t_hsimInfoPdgMatched, t_hsimInfoPhoton, t_hsimInfoRest, t_hsimInfoTotal, t_nSimHits, t_trackEta, t_trackHcalEta, t_trackHcalPhi, t_trackP, t_trackPhi, and t_trackPt.

Referenced by analyze().

369  {
370 
371  t_trackP ->clear();
372  t_trackPt ->clear();
373  t_trackEta ->clear();
374  t_trackPhi ->clear();
375  t_trackHcalEta ->clear();
376  t_trackHcalPhi ->clear();
377  t_hCone ->clear();
378  t_conehmaxNearP ->clear();
379  t_eMipDR ->clear();
380  t_eECALDR ->clear();
381  t_eHCALDR ->clear();
382  t_e11x11_20Sig ->clear();
383  t_e15x15_20Sig ->clear();
384 
385  if (doMC) {
386  t_hsimInfoMatched ->clear();
387  t_hsimInfoRest ->clear();
388  t_hsimInfoPhoton ->clear();
389  t_hsimInfoNeutHad ->clear();
390  t_hsimInfoCharHad ->clear();
391  t_hsimInfoPdgMatched ->clear();
392  t_hsimInfoTotal ->clear();
393  t_hsimInfoNMatched ->clear();
394  t_hsimInfoNTotal ->clear();
395  t_hsimInfoNNeutHad ->clear();
396  t_hsimInfoNCharHad ->clear();
397  t_hsimInfoNPhoton ->clear();
398  t_hsimInfoNRest ->clear();
399  t_hsim ->clear();
400  t_nSimHits ->clear();
401  }
402 }
std::vector< double > * t_hsimInfoMatched
std::vector< double > * t_eHCALDR
std::vector< int > * t_hsimInfoNRest
std::vector< double > * t_hCone
std::vector< int > * t_hsimInfoNTotal
std::vector< int > * t_hsimInfoNCharHad
std::vector< int > * t_hsimInfoNMatched
std::vector< double > * t_hsim
std::vector< double > * t_hsimInfoNeutHad
std::vector< int > * t_hsimInfoNPhoton
std::vector< double > * t_e11x11_20Sig
std::vector< int > * t_hsimInfoNNeutHad
std::vector< double > * t_trackEta
std::vector< double > * t_eECALDR
std::vector< double > * t_trackPt
std::vector< double > * t_trackHcalEta
std::vector< double > * t_trackP
std::vector< double > * t_trackHcalPhi
std::vector< double > * t_hsimInfoPhoton
std::vector< double > * t_hsimInfoTotal
std::vector< double > * t_hsimInfoCharHad
std::vector< double > * t_trackPhi
std::vector< double > * t_hsimInfoPdgMatched
std::vector< int > * t_nSimHits
std::vector< double > * t_hsimInfoRest
std::vector< double > * t_conehmaxNearP
std::vector< double > * t_e15x15_20Sig
std::vector< double > * t_eMipDR
void IsolatedTracksHcalScale::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 364 of file IsolatedTracksHcalScale.cc.

References gather_cfg::cout, and nEventProc.

364  {
365 
366  std::cout << "Number of Events Processed " << nEventProc << std::endl;
367 }
tuple cout
Definition: gather_cfg.py:41

Member Data Documentation

double IsolatedTracksHcalScale::a_charIsoR
private

Definition at line 132 of file IsolatedTracksHcalScale.h.

Referenced by analyze(), and IsolatedTracksHcalScale().

double IsolatedTracksHcalScale::a_coneR
private

Definition at line 132 of file IsolatedTracksHcalScale.h.

Referenced by analyze(), and IsolatedTracksHcalScale().

double IsolatedTracksHcalScale::a_mipR
private

Definition at line 132 of file IsolatedTracksHcalScale.h.

Referenced by analyze(), and IsolatedTracksHcalScale().

double IsolatedTracksHcalScale::a_neutIsoR
private

Definition at line 132 of file IsolatedTracksHcalScale.h.

Referenced by analyze(), and IsolatedTracksHcalScale().

const MagneticField* IsolatedTracksHcalScale::bField
private

Definition at line 155 of file IsolatedTracksHcalScale.h.

Referenced by analyze().

bool IsolatedTracksHcalScale::doMC
private
edm::Service<TFileService> IsolatedTracksHcalScale::fs
private

Definition at line 174 of file IsolatedTracksHcalScale.h.

Referenced by beginJob().

double IsolatedTracksHcalScale::genPartEtaBins[4]
private

Definition at line 157 of file IsolatedTracksHcalScale.h.

bool IsolatedTracksHcalScale::initL1
private

Definition at line 128 of file IsolatedTracksHcalScale.h.

Referenced by IsolatedTracksHcalScale().

std::string IsolatedTracksHcalScale::minQuality
private

Definition at line 130 of file IsolatedTracksHcalScale.h.

int IsolatedTracksHcalScale::myverbose
private

Definition at line 129 of file IsolatedTracksHcalScale.h.

Referenced by analyze(), and IsolatedTracksHcalScale().

const size_t IsolatedTracksHcalScale::NEtaBins = 3
staticprivate

Definition at line 159 of file IsolatedTracksHcalScale.h.

int IsolatedTracksHcalScale::nEventProc
private

Definition at line 149 of file IsolatedTracksHcalScale.h.

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

spr::trackSelectionParameters IsolatedTracksHcalScale::selectionParameters
private

Definition at line 131 of file IsolatedTracksHcalScale.h.

Referenced by analyze(), and IsolatedTracksHcalScale().

int IsolatedTracksHcalScale::t_Bunch
private

Definition at line 163 of file IsolatedTracksHcalScale.h.

Referenced by analyze(), and beginJob().

std::vector<double> * IsolatedTracksHcalScale::t_conehmaxNearP
private

Definition at line 166 of file IsolatedTracksHcalScale.h.

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

std::vector<double>* IsolatedTracksHcalScale::t_e11x11_20Sig
private

Definition at line 167 of file IsolatedTracksHcalScale.h.

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

std::vector<double> * IsolatedTracksHcalScale::t_e15x15_20Sig
private

Definition at line 167 of file IsolatedTracksHcalScale.h.

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

std::vector<double> * IsolatedTracksHcalScale::t_eECALDR
private

Definition at line 166 of file IsolatedTracksHcalScale.h.

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

std::vector<double> * IsolatedTracksHcalScale::t_eHCALDR
private

Definition at line 165 of file IsolatedTracksHcalScale.h.

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

std::vector<double> * IsolatedTracksHcalScale::t_eMipDR
private

Definition at line 166 of file IsolatedTracksHcalScale.h.

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

int IsolatedTracksHcalScale::t_EvtNo
private

Definition at line 163 of file IsolatedTracksHcalScale.h.

Referenced by analyze().

std::vector<double>* IsolatedTracksHcalScale::t_hCone
private

Definition at line 166 of file IsolatedTracksHcalScale.h.

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

std::vector<double> * IsolatedTracksHcalScale::t_hsim
private

Definition at line 170 of file IsolatedTracksHcalScale.h.

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

std::vector<double> * IsolatedTracksHcalScale::t_hsimInfoCharHad
private

Definition at line 169 of file IsolatedTracksHcalScale.h.

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

std::vector<double>* IsolatedTracksHcalScale::t_hsimInfoMatched
private

Definition at line 168 of file IsolatedTracksHcalScale.h.

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

std::vector<int>* IsolatedTracksHcalScale::t_hsimInfoNCharHad
private

Definition at line 172 of file IsolatedTracksHcalScale.h.

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

std::vector<double>* IsolatedTracksHcalScale::t_hsimInfoNeutHad
private

Definition at line 169 of file IsolatedTracksHcalScale.h.

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

std::vector<int>* IsolatedTracksHcalScale::t_hsimInfoNMatched
private

Definition at line 171 of file IsolatedTracksHcalScale.h.

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

std::vector<int> * IsolatedTracksHcalScale::t_hsimInfoNNeutHad
private

Definition at line 171 of file IsolatedTracksHcalScale.h.

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

std::vector<int> * IsolatedTracksHcalScale::t_hsimInfoNPhoton
private

Definition at line 172 of file IsolatedTracksHcalScale.h.

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

std::vector<int> * IsolatedTracksHcalScale::t_hsimInfoNRest
private

Definition at line 172 of file IsolatedTracksHcalScale.h.

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

std::vector<int> * IsolatedTracksHcalScale::t_hsimInfoNTotal
private

Definition at line 171 of file IsolatedTracksHcalScale.h.

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

std::vector<double> * IsolatedTracksHcalScale::t_hsimInfoPdgMatched
private

Definition at line 169 of file IsolatedTracksHcalScale.h.

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

std::vector<double> * IsolatedTracksHcalScale::t_hsimInfoPhoton
private

Definition at line 168 of file IsolatedTracksHcalScale.h.

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

std::vector<double> * IsolatedTracksHcalScale::t_hsimInfoRest
private

Definition at line 168 of file IsolatedTracksHcalScale.h.

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

std::vector<double>* IsolatedTracksHcalScale::t_hsimInfoTotal
private

Definition at line 170 of file IsolatedTracksHcalScale.h.

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

int IsolatedTracksHcalScale::t_Lumi
private

Definition at line 163 of file IsolatedTracksHcalScale.h.

Referenced by analyze(), and beginJob().

std::vector<int>* IsolatedTracksHcalScale::t_nSimHits
private

Definition at line 173 of file IsolatedTracksHcalScale.h.

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

int IsolatedTracksHcalScale::t_nTracks
private

Definition at line 163 of file IsolatedTracksHcalScale.h.

int IsolatedTracksHcalScale::t_RunNo
private

Definition at line 163 of file IsolatedTracksHcalScale.h.

Referenced by analyze(), and beginJob().

std::vector<double> * IsolatedTracksHcalScale::t_trackEta
private

Definition at line 164 of file IsolatedTracksHcalScale.h.

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

std::vector<double>* IsolatedTracksHcalScale::t_trackHcalEta
private

Definition at line 165 of file IsolatedTracksHcalScale.h.

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

std::vector<double> * IsolatedTracksHcalScale::t_trackHcalPhi
private

Definition at line 165 of file IsolatedTracksHcalScale.h.

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

std::vector<double>* IsolatedTracksHcalScale::t_trackP
private

Definition at line 164 of file IsolatedTracksHcalScale.h.

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

std::vector<double> * IsolatedTracksHcalScale::t_trackPhi
private

Definition at line 164 of file IsolatedTracksHcalScale.h.

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

std::vector<double> * IsolatedTracksHcalScale::t_trackPt
private

Definition at line 164 of file IsolatedTracksHcalScale.h.

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

std::string IsolatedTracksHcalScale::theTrackQuality
private

Definition at line 130 of file IsolatedTracksHcalScale.h.

Referenced by analyze(), and IsolatedTracksHcalScale().

double IsolatedTracksHcalScale::tMaxE_
private

Definition at line 133 of file IsolatedTracksHcalScale.h.

Referenced by analyze(), and IsolatedTracksHcalScale().

double IsolatedTracksHcalScale::tMinE_
private

Definition at line 133 of file IsolatedTracksHcalScale.h.

Referenced by analyze(), and IsolatedTracksHcalScale().

TTree* IsolatedTracksHcalScale::tree
private