CMS 3D CMS Logo

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

#include <MCPhotonAnalyzer.h>

Inheritance diagram for MCPhotonAnalyzer:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
 MCPhotonAnalyzer (const edm::ParameterSet &)
 
 ~MCPhotonAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 Member Functions

float etaTransformation (float a, float b)
 
float phiNormalization (float &a)
 

Private Attributes

TFile * fOutputFile_
 
std::string fOutputFileName_
 
TH1F * h_BremEnergy_
 
TH2F * h_bremEvsEleE_
 
TH1F * h_BremFrac_
 
TH2F * h_bremFracVsConvR_
 
TH1F * h_convFracEta1_
 
TH1F * h_convFracEta2_
 
TH1F * h_convFracEta3_
 
TH1F * h_convFracEta4_
 
TH2F * h_EleEvsPhoE_
 
TH1F * h_MCConvPhoE_
 
TH1F * h_MCConvPhoEta_
 
TH1F * h_MCConvPhoOneTrackE_
 Conversions with one track. More...
 
TH1F * h_MCConvPhoOneTrackEta_
 
TH1F * h_MCConvPhoOneTrackPhi_
 
TH1F * h_MCConvPhoOneTrackR_
 
TH1F * h_MCConvPhoPhi_
 
TH1F * h_MCConvPhoR_
 
TH1F * h_MCConvPhoREta1_
 
TH1F * h_MCConvPhoREta2_
 
TH1F * h_MCConvPhoREta3_
 
TH1F * h_MCConvPhoREta4_
 
TH1F * h_MCConvPhoTwoTracksE_
 Conversions with two tracks. More...
 
TH1F * h_MCConvPhoTwoTracksEta_
 
TH1F * h_MCConvPhoTwoTracksPhi_
 
TH1F * h_MCConvPhoTwoTracksR_
 
TH1F * h_MCEleE_
 
TH1F * h_MCEleEta_
 
TH1F * h_MCElePhi_
 
TH1F * h_MCPhoE_
 
TH1F * h_MCPhoEta1_
 
TH1F * h_MCPhoEta2_
 
TH1F * h_MCPhoEta3_
 
TH1F * h_MCPhoEta4_
 
TH1F * h_MCPhoEta_
 
TH1F * h_MCPhoPhi_
 
std::string HepMCLabel
 
double mcEta_
 
double mcPhi_
 global variable for the MC photon More...
 
int nEvt_
 
int nMatched_
 
TProfile * p_BremVsConvEta_
 
TProfile * p_BremVsConvR_
 
TProfile * p_BremVsEta_
 
TProfile * p_BremVsR_
 
std::string SimHitLabel
 
std::string SimTkLabel
 
std::string SimVtxLabel
 
PhotonMCTruthFinderthePhotonMCTruthFinder_
 
const TrackerGeometrytrackerGeom
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 20 of file MCPhotonAnalyzer.h.

Constructor & Destructor Documentation

◆ MCPhotonAnalyzer()

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

Definition at line 45 of file MCPhotonAnalyzer.cc.

45 {}

◆ ~MCPhotonAnalyzer()

MCPhotonAnalyzer::~MCPhotonAnalyzer ( )
override

Definition at line 47 of file MCPhotonAnalyzer.cc.

47 { delete thePhotonMCTruthFinder_; }

Member Function Documentation

◆ analyze()

void MCPhotonAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup  
)
overridevirtual

Loop over all MC photons in the event

Implements edm::one::EDAnalyzerBase.

Definition at line 166 of file MCPhotonAnalyzer.cc.

166  {
167  using namespace edm;
168  //UNUSED const float etaPhiDistance=0.01;
169  // Fiducial region
170  //UNUSED const float TRK_BARL =0.9;
171  //UNUSED const float BARL = 1.4442; // DAQ TDR p.290
172  //UNUSED const float END_LO = 1.566;
173  //UNUSED const float END_HI = 2.5;
174  // Electron mass
175  //UNUSED const Float_t mElec= 0.000511;
176 
177  nEvt_++;
178  LogInfo("mcEleAnalyzer") << "MCPhotonAnalyzer Analyzing event number: " << e.id() << " Global Counter " << nEvt_
179  << "\n";
180  // LogDebug("MCPhotonAnalyzer") << "MCPhotonAnalyzer Analyzing event number: " << e.id() << " Global Counter " << nEvt_ <<"\n";
181  std::cout << "MCPhotonAnalyzer Analyzing event number: " << e.id() << " Global Counter " << nEvt_ << "\n";
182 
184  std::cout << " MCPhotonAnalyzer Looking for MC truth "
185  << "\n";
186 
187  //get simtrack info
188  std::vector<SimTrack> theSimTracks;
189  std::vector<SimVertex> theSimVertices;
190 
193  e.getByLabel("g4SimHits", SimTk);
194  e.getByLabel("g4SimHits", SimVtx);
195 
196  theSimTracks.insert(theSimTracks.end(), SimTk->begin(), SimTk->end());
197  theSimVertices.insert(theSimVertices.end(), SimVtx->begin(), SimVtx->end());
198  std::cout << " MCPhotonAnalyzer This Event has " << theSimTracks.size() << " sim tracks " << std::endl;
199  std::cout << " MCPhotonAnalyzer This Event has " << theSimVertices.size() << " sim vertices " << std::endl;
200  if (theSimTracks.empty())
201  std::cout << " Event number " << e.id() << " has NO sim tracks " << std::endl;
202 
203  std::vector<PhotonMCTruth> mcPhotons = thePhotonMCTruthFinder_->find(theSimTracks, theSimVertices);
204  std::cout << " MCPhotonAnalyzer mcPhotons size " << mcPhotons.size() << std::endl;
205 
206  for (std::vector<PhotonMCTruth>::const_iterator iPho = mcPhotons.begin(); iPho != mcPhotons.end(); ++iPho) {
207  if ((*iPho).fourMomentum().e() < 35)
208  continue;
209 
210  h_MCPhoE_->Fill((*iPho).fourMomentum().e());
211  // float correta = etaTransformation( (*iPho).fourMomentum().pseudoRapidity(), (*iPho).primaryVertex().z() );
212  float Theta = (*iPho).fourMomentum().theta();
213  float correta = -log(tan(0.5 * Theta));
214  correta = etaTransformation(correta, (*iPho).primaryVertex().z());
215  //h_MCPhoEta_->Fill ( (*iPho).fourMomentum().pseudoRapidity() );
216  h_MCPhoEta_->Fill(fabs(correta) - 0.001);
217  h_MCPhoPhi_->Fill((*iPho).fourMomentum().phi());
218 
219  /*
220  if ( fabs((*iPho).fourMomentum().pseudoRapidity() ) <= 0.25 && fabs((*iPho).fourMomentum().pseudoRapidity() ) >=0.15 )
221  h_MCPhoEta1_->Fill ( (*iPho).fourMomentum().pseudoRapidity() );
222  if ( fabs((*iPho).fourMomentum().pseudoRapidity() ) <= 0.95 && fabs((*iPho).fourMomentum().pseudoRapidity() ) >=0.85 )
223  h_MCPhoEta2_->Fill ( (*iPho).fourMomentum().pseudoRapidity() );
224  if ( fabs((*iPho).fourMomentum().pseudoRapidity() ) <= 1.65 && fabs((*iPho).fourMomentum().pseudoRapidity() ) >=1.55 )
225  h_MCPhoEta3_->Fill ( (*iPho).fourMomentum().pseudoRapidity() );
226  if ( fabs((*iPho).fourMomentum().pseudoRapidity() ) <= 2.05 && fabs((*iPho).fourMomentum().pseudoRapidity() ) >=1.95 )
227  h_MCPhoEta4_->Fill ( (*iPho).fourMomentum().pseudoRapidity() );
228  */
229 
230  if (fabs(correta) <= 0.3 && fabs(correta) > 0.2)
231  h_MCPhoEta1_->Fill(correta);
232  if (fabs(correta) <= 1.00 && fabs(correta) > 0.9)
233  h_MCPhoEta2_->Fill(correta);
234  if (fabs(correta) <= 1.6 && fabs(correta) > 1.5)
235  h_MCPhoEta3_->Fill(correta);
236  if (fabs(correta) <= 2. && fabs(correta) > 1.9)
237  h_MCPhoEta4_->Fill(correta);
238 
239  // if ( (*iPho).isAConversion() && (*iPho).vertex().perp()< 10 ) {
240  if ((*iPho).isAConversion()) {
241  h_MCConvPhoE_->Fill((*iPho).fourMomentum().e());
242  // h_MCConvPhoEta_->Fill ( (*iPho).fourMomentum().pseudoRapidity() );
243 
244  h_MCConvPhoEta_->Fill(fabs(correta) - 0.001);
245  h_MCConvPhoPhi_->Fill((*iPho).fourMomentum().phi());
246  h_MCConvPhoR_->Fill((*iPho).vertex().perp());
247 
248  /*
249  if ( fabs((*iPho).fourMomentum().pseudoRapidity() ) <= 0.25 && fabs((*iPho).fourMomentum().pseudoRapidity() ) >=0.15 )
250  h_MCConvPhoREta1_->Fill ( (*iPho).vertex().perp() );
251  if ( fabs((*iPho).fourMomentum().pseudoRapidity() ) <= 0.95 && fabs((*iPho).fourMomentum().pseudoRapidity() ) >=0.85 )
252  h_MCConvPhoREta2_->Fill ( (*iPho).vertex().perp() );
253  if ( fabs((*iPho).fourMomentum().pseudoRapidity() ) <= 1.65 && fabs((*iPho).fourMomentum().pseudoRapidity() ) >=1.55 )
254  h_MCConvPhoREta3_->Fill ( (*iPho).vertex().perp() );
255  if ( fabs((*iPho).fourMomentum().pseudoRapidity() ) <= 2.05 && fabs((*iPho).fourMomentum().pseudoRapidity() ) >=1.95 )
256  h_MCConvPhoREta4_->Fill ( (*iPho).vertex().perp() );
257  */
258 
259  if (fabs(correta) <= 0.3 && fabs(correta) > 0.2)
260  h_MCConvPhoREta1_->Fill((*iPho).vertex().perp());
261  if (fabs(correta) <= 1. && fabs(correta) > 0.9)
262  h_MCConvPhoREta2_->Fill((*iPho).vertex().perp());
263  if (fabs(correta) <= 1.6 && fabs(correta) > 1.5)
264  h_MCConvPhoREta3_->Fill((*iPho).vertex().perp());
265  if (fabs(correta) <= 2 && fabs(correta) > 1.9)
266  h_MCConvPhoREta4_->Fill((*iPho).vertex().perp());
267 
268  } // end conversions
269 
270  }
271 }

References gather_cfg::cout, MillePedeFileConverter_cfg::e, dqm-mbProfile::log, and funct::tan().

◆ beginJob()

void MCPhotonAnalyzer::beginJob ( void  )
overridevirtual

conversions

conversions with two tracks

electrons from conversions

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 49 of file MCPhotonAnalyzer.cc.

49  {
50  nEvt_ = 0;
51 
53 
55 
57  h_MCPhoE_ = fs->make<TH1F>("MCPhoE", "MC photon energy", 100, 0., 100.);
58  h_MCPhoPhi_ = fs->make<TH1F>("MCPhoPhi", "MC photon phi", 40, -3.14, 3.14);
59  h_MCPhoEta_ = fs->make<TH1F>("MCPhoEta", "MC photon eta", 25, 0., 2.5);
60  h_MCPhoEta1_ = fs->make<TH1F>("MCPhoEta1", "MC photon eta", 40, -3., 3.);
61  h_MCPhoEta2_ = fs->make<TH1F>("MCPhoEta2", "MC photon eta", 40, -3., 3.);
62  h_MCPhoEta3_ = fs->make<TH1F>("MCPhoEta3", "MC photon eta", 40, -3., 3.);
63  h_MCPhoEta4_ = fs->make<TH1F>("MCPhoEta4", "MC photon eta", 40, -3., 3.);
65  h_MCConvPhoE_ = fs->make<TH1F>("MCConvPhoE", "MC converted photon energy", 100, 0., 100.);
66  h_MCConvPhoPhi_ = fs->make<TH1F>("MCConvPhoPhi", "MC converted photon phi", 40, -3.14, 3.14);
67  h_MCConvPhoEta_ = fs->make<TH1F>("MCConvPhoEta", "MC converted photon eta", 25, 0., 2.5);
68  h_MCConvPhoR_ = fs->make<TH1F>("MCConvPhoR", "MC converted photon R", 120, 0., 120.);
69 
70  h_MCConvPhoREta1_ = fs->make<TH1F>("MCConvPhoREta1", "MC converted photon R", 120, 0., 120.);
71  h_MCConvPhoREta2_ = fs->make<TH1F>("MCConvPhoREta2", "MC converted photon R", 120, 0., 120.);
72  h_MCConvPhoREta3_ = fs->make<TH1F>("MCConvPhoREta3", "MC converted photon R", 120, 0., 120.);
73  h_MCConvPhoREta4_ = fs->make<TH1F>("MCConvPhoREta4", "MC converted photon R", 120, 0., 120.);
74 
75  h_convFracEta1_ = fs->make<TH1F>("convFracEta1", "Integrated(R) fraction of conversion |eta|=0.2", 120, 0., 120.);
76  h_convFracEta2_ = fs->make<TH1F>("convFracEta2", "Integrated(R) fraction of conversion |eta|=0.9", 120, 0., 120.);
77  h_convFracEta3_ = fs->make<TH1F>("convFracEta3", "Integrated(R) fraction of conversion |eta|=1.5", 120, 0., 120.);
78  h_convFracEta4_ = fs->make<TH1F>("convFracEta4", "Integrated(R) fraction of conversion |eta|=2.0", 120, 0., 120.);
81  fs->make<TH1F>("MCConvPhoTwoTracksE", "MC converted photon with 2 tracks energy", 100, 0., 100.);
83  fs->make<TH1F>("MCConvPhoTwoTracksPhi", "MC converted photon 2 tracks phi", 40, -3.14, 3.14);
84  h_MCConvPhoTwoTracksEta_ = fs->make<TH1F>("MCConvPhoTwoTracksEta", "MC converted photon 2 tracks eta", 40, -3., 3.);
85  h_MCConvPhoTwoTracksR_ = fs->make<TH1F>("MCConvPhoTwoTracksR", "MC converted photon 2 tracks eta", 48, 0., 120.);
86  // conversions with one track
88  fs->make<TH1F>("MCConvPhoOneTrackE", "MC converted photon with 1 track energy", 100, 0., 100.);
89  h_MCConvPhoOneTrackPhi_ = fs->make<TH1F>("MCConvPhoOneTrackPhi", "MC converted photon 1 track phi", 40, -3.14, 3.14);
90  h_MCConvPhoOneTrackEta_ = fs->make<TH1F>("MCConvPhoOneTrackEta", "MC converted photon 1 track eta", 40, -3., 3.);
91  h_MCConvPhoOneTrackR_ = fs->make<TH1F>("MCConvPhoOneTrackR", "MC converted photon 1 track eta", 48, 0., 120.);
92 
94  h_MCEleE_ = fs->make<TH1F>("MCEleE", "MC ele energy", 100, 0., 200.);
95  h_MCElePhi_ = fs->make<TH1F>("MCElePhi", "MC ele phi", 40, -3.14, 3.14);
96  h_MCEleEta_ = fs->make<TH1F>("MCEleEta", "MC ele eta", 40, -3., 3.);
97  h_BremFrac_ = fs->make<TH1F>("bremFrac", "brem frac ", 100, 0., 1.);
98  h_BremEnergy_ = fs->make<TH1F>("BremE", "Brem energy", 100, 0., 200.);
99  h_EleEvsPhoE_ = fs->make<TH2F>("eleEvsPhoE", "eleEvsPhoE", 100, 0., 200., 100, 0., 200.);
100  h_bremEvsEleE_ = fs->make<TH2F>("bremEvsEleE", "bremEvsEleE", 100, 0., 200., 100, 0., 200.);
101 
102  p_BremVsR_ = fs->make<TProfile>("BremVsR", " Mean Brem Energy vs R ", 48, 0., 120.);
103  p_BremVsEta_ = fs->make<TProfile>("BremVsEta", " Mean Brem Energy vs Eta ", 50, -2.5, 2.5);
104 
105  p_BremVsConvR_ = fs->make<TProfile>("BremVsConvR", " Mean Brem Fraction vs conversion R ", 48, 0., 120.);
106  p_BremVsConvEta_ = fs->make<TProfile>("BremVsConvEta", " Mean Brem Fraction vs converion Eta ", 50, -2.5, 2.5);
107 
108  h_bremFracVsConvR_ = fs->make<TH2F>("bremFracVsConvR", "brem Fraction vs conversion R", 60, 0., 120., 100, 0., 1.);
109 
110  return;
111 }

References TFileService::make().

◆ endJob()

void MCPhotonAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 273 of file MCPhotonAnalyzer.cc.

273  {
274  Double_t s1 = 0;
275  Double_t s2 = 0;
276  Double_t s3 = 0;
277  Double_t s4 = 0;
278  int e1 = 0;
279  int e2 = 0;
280  int e3 = 0;
281  int e4 = 0;
282 
283  Double_t nTotEta1 = h_MCPhoEta1_->GetEntries();
284  Double_t nTotEta2 = h_MCPhoEta2_->GetEntries();
285  Double_t nTotEta3 = h_MCPhoEta3_->GetEntries();
286  Double_t nTotEta4 = h_MCPhoEta4_->GetEntries();
287 
288  for (int i = 1; i <= 120; ++i) {
289  e1 = (int)h_MCConvPhoREta1_->GetBinContent(i);
290  e2 = (int)h_MCConvPhoREta2_->GetBinContent(i);
291  e3 = (int)h_MCConvPhoREta3_->GetBinContent(i);
292  e4 = (int)h_MCConvPhoREta4_->GetBinContent(i);
293  s1 += e1;
294  s2 += e2;
295  s3 += e3;
296  s4 += e4;
297  h_convFracEta1_->SetBinContent(i, s1 * 100 / nTotEta1);
298  h_convFracEta2_->SetBinContent(i, s2 * 100 / nTotEta2);
299  h_convFracEta3_->SetBinContent(i, s3 * 100 / nTotEta3);
300  h_convFracEta4_->SetBinContent(i, s4 * 100 / nTotEta4);
301  }
302 
303  edm::LogInfo("MCPhotonAnalyzer") << "Analyzed " << nEvt_ << "\n";
304  std::cout << "MCPhotonAnalyzer::endJob Analyzed " << nEvt_ << " events "
305  << "\n";
306 
307  return;
308 }

References gather_cfg::cout, StorageManager_cfg::e1, SiPixelPhase1Clusters_cfi::e3, vertexPlots::e4, mps_fire::i, createfilelist::int, and indexGen::s2.

◆ etaTransformation()

float MCPhotonAnalyzer::etaTransformation ( float  a,
float  b 
)
private

Definition at line 113 of file MCPhotonAnalyzer.cc.

113  {
114  //---Definitions
115  const float PI = 3.1415927;
116  // const float TWOPI = 2.0*PI;
117 
118  //---Definitions for ECAL
119  const float R_ECAL = 136.5;
120  const float Z_Endcap = 328.0;
121  const float etaBarrelEndcap = 1.479;
122 
123  //---ETA correction
124 
125  float Theta = 0.0;
126  float ZEcal = R_ECAL * sinh(EtaParticle) + Zvertex;
127 
128  if (ZEcal != 0.0)
129  Theta = atan(R_ECAL / ZEcal);
130  if (Theta < 0.0)
131  Theta = Theta + PI;
132  float ETA = -log(tan(0.5 * Theta));
133 
134  if (fabs(ETA) > etaBarrelEndcap) {
135  float Zend = Z_Endcap;
136  if (EtaParticle < 0.0)
137  Zend = -Zend;
138  float Zlen = Zend - Zvertex;
139  float RR = Zlen / sinh(EtaParticle);
140  Theta = atan(RR / Zend);
141  if (Theta < 0.0)
142  Theta = Theta + PI;
143  ETA = -log(tan(0.5 * Theta));
144  }
145  //---Return the result
146  return ETA;
147  //---end
148 }

References ETA, etaBarrelEndcap, dqm-mbProfile::log, PI, R_ECAL, funct::tan(), Z_Endcap, and ZEcal.

◆ phiNormalization()

float MCPhotonAnalyzer::phiNormalization ( float &  a)
private

Definition at line 150 of file MCPhotonAnalyzer.cc.

150  {
151  //---Definitions
152  const float PI = 3.1415927;
153  const float TWOPI = 2.0 * PI;
154 
155  if (phi > PI) {
156  phi = phi - TWOPI;
157  }
158  if (phi < -PI) {
159  phi = phi + TWOPI;
160  }
161 
162  // cout << " Float_t PHInormalization out " << PHI << endl;
163  return phi;
164 }

References PI, and TWOPI.

Member Data Documentation

◆ fOutputFile_

TFile* MCPhotonAnalyzer::fOutputFile_
private

Definition at line 40 of file MCPhotonAnalyzer.h.

◆ fOutputFileName_

std::string MCPhotonAnalyzer::fOutputFileName_
private

Definition at line 39 of file MCPhotonAnalyzer.h.

◆ h_BremEnergy_

TH1F* MCPhotonAnalyzer::h_BremEnergy_
private

Definition at line 92 of file MCPhotonAnalyzer.h.

◆ h_bremEvsEleE_

TH2F* MCPhotonAnalyzer::h_bremEvsEleE_
private

Definition at line 94 of file MCPhotonAnalyzer.h.

◆ h_BremFrac_

TH1F* MCPhotonAnalyzer::h_BremFrac_
private

Definition at line 91 of file MCPhotonAnalyzer.h.

◆ h_bremFracVsConvR_

TH2F* MCPhotonAnalyzer::h_bremFracVsConvR_
private

Definition at line 102 of file MCPhotonAnalyzer.h.

◆ h_convFracEta1_

TH1F* MCPhotonAnalyzer::h_convFracEta1_
private

Definition at line 72 of file MCPhotonAnalyzer.h.

◆ h_convFracEta2_

TH1F* MCPhotonAnalyzer::h_convFracEta2_
private

Definition at line 73 of file MCPhotonAnalyzer.h.

◆ h_convFracEta3_

TH1F* MCPhotonAnalyzer::h_convFracEta3_
private

Definition at line 74 of file MCPhotonAnalyzer.h.

◆ h_convFracEta4_

TH1F* MCPhotonAnalyzer::h_convFracEta4_
private

Definition at line 75 of file MCPhotonAnalyzer.h.

◆ h_EleEvsPhoE_

TH2F* MCPhotonAnalyzer::h_EleEvsPhoE_
private

Definition at line 93 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoE_

TH1F* MCPhotonAnalyzer::h_MCConvPhoE_
private

Definition at line 64 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoEta_

TH1F* MCPhotonAnalyzer::h_MCConvPhoEta_
private

Definition at line 65 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoOneTrackE_

TH1F* MCPhotonAnalyzer::h_MCConvPhoOneTrackE_
private

Conversions with one track.

Definition at line 83 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoOneTrackEta_

TH1F* MCPhotonAnalyzer::h_MCConvPhoOneTrackEta_
private

Definition at line 84 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoOneTrackPhi_

TH1F* MCPhotonAnalyzer::h_MCConvPhoOneTrackPhi_
private

Definition at line 85 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoOneTrackR_

TH1F* MCPhotonAnalyzer::h_MCConvPhoOneTrackR_
private

Definition at line 86 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoPhi_

TH1F* MCPhotonAnalyzer::h_MCConvPhoPhi_
private

Definition at line 66 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoR_

TH1F* MCPhotonAnalyzer::h_MCConvPhoR_
private

Definition at line 67 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoREta1_

TH1F* MCPhotonAnalyzer::h_MCConvPhoREta1_
private

Definition at line 68 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoREta2_

TH1F* MCPhotonAnalyzer::h_MCConvPhoREta2_
private

Definition at line 69 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoREta3_

TH1F* MCPhotonAnalyzer::h_MCConvPhoREta3_
private

Definition at line 70 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoREta4_

TH1F* MCPhotonAnalyzer::h_MCConvPhoREta4_
private

Definition at line 71 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoTwoTracksE_

TH1F* MCPhotonAnalyzer::h_MCConvPhoTwoTracksE_
private

Conversions with two tracks.

Definition at line 78 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoTwoTracksEta_

TH1F* MCPhotonAnalyzer::h_MCConvPhoTwoTracksEta_
private

Definition at line 79 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoTwoTracksPhi_

TH1F* MCPhotonAnalyzer::h_MCConvPhoTwoTracksPhi_
private

Definition at line 80 of file MCPhotonAnalyzer.h.

◆ h_MCConvPhoTwoTracksR_

TH1F* MCPhotonAnalyzer::h_MCConvPhoTwoTracksR_
private

Definition at line 81 of file MCPhotonAnalyzer.h.

◆ h_MCEleE_

TH1F* MCPhotonAnalyzer::h_MCEleE_
private

Definition at line 88 of file MCPhotonAnalyzer.h.

◆ h_MCEleEta_

TH1F* MCPhotonAnalyzer::h_MCEleEta_
private

Definition at line 89 of file MCPhotonAnalyzer.h.

◆ h_MCElePhi_

TH1F* MCPhotonAnalyzer::h_MCElePhi_
private

Definition at line 90 of file MCPhotonAnalyzer.h.

◆ h_MCPhoE_

TH1F* MCPhotonAnalyzer::h_MCPhoE_
private

Definition at line 56 of file MCPhotonAnalyzer.h.

◆ h_MCPhoEta1_

TH1F* MCPhotonAnalyzer::h_MCPhoEta1_
private

Definition at line 58 of file MCPhotonAnalyzer.h.

◆ h_MCPhoEta2_

TH1F* MCPhotonAnalyzer::h_MCPhoEta2_
private

Definition at line 59 of file MCPhotonAnalyzer.h.

◆ h_MCPhoEta3_

TH1F* MCPhotonAnalyzer::h_MCPhoEta3_
private

Definition at line 60 of file MCPhotonAnalyzer.h.

◆ h_MCPhoEta4_

TH1F* MCPhotonAnalyzer::h_MCPhoEta4_
private

Definition at line 61 of file MCPhotonAnalyzer.h.

◆ h_MCPhoEta_

TH1F* MCPhotonAnalyzer::h_MCPhoEta_
private

Definition at line 57 of file MCPhotonAnalyzer.h.

◆ h_MCPhoPhi_

TH1F* MCPhotonAnalyzer::h_MCPhoPhi_
private

Definition at line 62 of file MCPhotonAnalyzer.h.

◆ HepMCLabel

std::string MCPhotonAnalyzer::HepMCLabel
private

Definition at line 50 of file MCPhotonAnalyzer.h.

◆ mcEta_

double MCPhotonAnalyzer::mcEta_
private

Definition at line 48 of file MCPhotonAnalyzer.h.

◆ mcPhi_

double MCPhotonAnalyzer::mcPhi_
private

global variable for the MC photon

Definition at line 47 of file MCPhotonAnalyzer.h.

◆ nEvt_

int MCPhotonAnalyzer::nEvt_
private

Definition at line 42 of file MCPhotonAnalyzer.h.

◆ nMatched_

int MCPhotonAnalyzer::nMatched_
private

Definition at line 43 of file MCPhotonAnalyzer.h.

◆ p_BremVsConvEta_

TProfile* MCPhotonAnalyzer::p_BremVsConvEta_
private

Definition at line 100 of file MCPhotonAnalyzer.h.

◆ p_BremVsConvR_

TProfile* MCPhotonAnalyzer::p_BremVsConvR_
private

Definition at line 99 of file MCPhotonAnalyzer.h.

◆ p_BremVsEta_

TProfile* MCPhotonAnalyzer::p_BremVsEta_
private

Definition at line 97 of file MCPhotonAnalyzer.h.

◆ p_BremVsR_

TProfile* MCPhotonAnalyzer::p_BremVsR_
private

Definition at line 96 of file MCPhotonAnalyzer.h.

◆ SimHitLabel

std::string MCPhotonAnalyzer::SimHitLabel
private

Definition at line 53 of file MCPhotonAnalyzer.h.

◆ SimTkLabel

std::string MCPhotonAnalyzer::SimTkLabel
private

Definition at line 51 of file MCPhotonAnalyzer.h.

◆ SimVtxLabel

std::string MCPhotonAnalyzer::SimVtxLabel
private

Definition at line 52 of file MCPhotonAnalyzer.h.

◆ thePhotonMCTruthFinder_

PhotonMCTruthFinder* MCPhotonAnalyzer::thePhotonMCTruthFinder_
private

Definition at line 35 of file MCPhotonAnalyzer.h.

◆ trackerGeom

const TrackerGeometry* MCPhotonAnalyzer::trackerGeom
private

Definition at line 37 of file MCPhotonAnalyzer.h.

PI
Definition: PayloadInspector.h:19
MCPhotonAnalyzer::nEvt_
int nEvt_
Definition: MCPhotonAnalyzer.h:42
mps_fire.i
i
Definition: mps_fire.py:355
MCPhotonAnalyzer::h_MCConvPhoTwoTracksPhi_
TH1F * h_MCConvPhoTwoTracksPhi_
Definition: MCPhotonAnalyzer.h:80
MCPhotonAnalyzer::h_MCConvPhoREta3_
TH1F * h_MCConvPhoREta3_
Definition: MCPhotonAnalyzer.h:70
PI
#define PI
Definition: QcdUeDQM.h:37
MCPhotonAnalyzer::h_convFracEta2_
TH1F * h_convFracEta2_
Definition: MCPhotonAnalyzer.h:73
MCPhotonAnalyzer::h_MCConvPhoTwoTracksEta_
TH1F * h_MCConvPhoTwoTracksEta_
Definition: MCPhotonAnalyzer.h:79
edm
HLT enums.
Definition: AlignableModifier.h:19
MCPhotonAnalyzer::h_MCPhoEta_
TH1F * h_MCPhoEta_
Definition: MCPhotonAnalyzer.h:57
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
MCPhotonAnalyzer::h_MCConvPhoTwoTracksR_
TH1F * h_MCConvPhoTwoTracksR_
Definition: MCPhotonAnalyzer.h:81
MCPhotonAnalyzer::h_BremEnergy_
TH1F * h_BremEnergy_
Definition: MCPhotonAnalyzer.h:92
MCPhotonAnalyzer::h_convFracEta3_
TH1F * h_convFracEta3_
Definition: MCPhotonAnalyzer.h:74
MCPhotonAnalyzer::p_BremVsConvR_
TProfile * p_BremVsConvR_
Definition: MCPhotonAnalyzer.h:99
MCPhotonAnalyzer::p_BremVsConvEta_
TProfile * p_BremVsConvEta_
Definition: MCPhotonAnalyzer.h:100
MCPhotonAnalyzer::p_BremVsR_
TProfile * p_BremVsR_
Definition: MCPhotonAnalyzer.h:96
indexGen.s2
s2
Definition: indexGen.py:107
MCPhotonAnalyzer::h_convFracEta4_
TH1F * h_convFracEta4_
Definition: MCPhotonAnalyzer.h:75
PhotonMCTruthFinder::find
std::vector< PhotonMCTruth > find(const std::vector< SimTrack > &simTracks, const std::vector< SimVertex > &simVertices)
Definition: PhotonMCTruthFinder.cc:17
edm::Handle
Definition: AssociativeIterator.h:50
MCPhotonAnalyzer::h_EleEvsPhoE_
TH2F * h_EleEvsPhoE_
Definition: MCPhotonAnalyzer.h:93
MCPhotonAnalyzer::h_MCEleEta_
TH1F * h_MCEleEta_
Definition: MCPhotonAnalyzer.h:89
MCPhotonAnalyzer::h_MCConvPhoOneTrackEta_
TH1F * h_MCConvPhoOneTrackEta_
Definition: MCPhotonAnalyzer.h:84
MCPhotonAnalyzer::h_MCConvPhoOneTrackPhi_
TH1F * h_MCConvPhoOneTrackPhi_
Definition: MCPhotonAnalyzer.h:85
MCPhotonAnalyzer::h_bremFracVsConvR_
TH2F * h_bremFracVsConvR_
Definition: MCPhotonAnalyzer.h:102
MCPhotonAnalyzer::h_MCConvPhoE_
TH1F * h_MCConvPhoE_
Definition: MCPhotonAnalyzer.h:64
MCPhotonAnalyzer::h_BremFrac_
TH1F * h_BremFrac_
Definition: MCPhotonAnalyzer.h:91
MCPhotonAnalyzer::p_BremVsEta_
TProfile * p_BremVsEta_
Definition: MCPhotonAnalyzer.h:97
MCPhotonAnalyzer::h_MCConvPhoPhi_
TH1F * h_MCConvPhoPhi_
Definition: MCPhotonAnalyzer.h:66
MCPhotonAnalyzer::h_MCElePhi_
TH1F * h_MCElePhi_
Definition: MCPhotonAnalyzer.h:90
MCPhotonAnalyzer::h_MCPhoPhi_
TH1F * h_MCPhoPhi_
Definition: MCPhotonAnalyzer.h:62
PhotonMCTruthFinder
Definition: PhotonMCTruthFinder.h:20
MCPhotonAnalyzer::h_MCConvPhoEta_
TH1F * h_MCConvPhoEta_
Definition: MCPhotonAnalyzer.h:65
MCPhotonAnalyzer::h_MCConvPhoTwoTracksE_
TH1F * h_MCConvPhoTwoTracksE_
Conversions with two tracks.
Definition: MCPhotonAnalyzer.h:78
TWOPI
#define TWOPI
Definition: DQMSourcePi0.cc:36
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
edm::Service< TFileService >
createfilelist.int
int
Definition: createfilelist.py:10
MCPhotonAnalyzer::h_MCConvPhoREta1_
TH1F * h_MCConvPhoREta1_
Definition: MCPhotonAnalyzer.h:68
MCPhotonAnalyzer::h_MCPhoE_
TH1F * h_MCPhoE_
Definition: MCPhotonAnalyzer.h:56
MCPhotonAnalyzer::h_MCEleE_
TH1F * h_MCEleE_
Definition: MCPhotonAnalyzer.h:88
MCPhotonAnalyzer::h_MCConvPhoR_
TH1F * h_MCConvPhoR_
Definition: MCPhotonAnalyzer.h:67
MCPhotonAnalyzer::h_convFracEta1_
TH1F * h_convFracEta1_
Definition: MCPhotonAnalyzer.h:72
MCPhotonAnalyzer::h_MCConvPhoOneTrackR_
TH1F * h_MCConvPhoOneTrackR_
Definition: MCPhotonAnalyzer.h:86
SiPixelPhase1Clusters_cfi.e3
e3
Definition: SiPixelPhase1Clusters_cfi.py:9
MCPhotonAnalyzer::h_MCConvPhoREta2_
TH1F * h_MCConvPhoREta2_
Definition: MCPhotonAnalyzer.h:69
DDAxes::phi
MCPhotonAnalyzer::h_MCPhoEta1_
TH1F * h_MCPhoEta1_
Definition: MCPhotonAnalyzer.h:58
MCPhotonAnalyzer::h_MCConvPhoREta4_
TH1F * h_MCConvPhoREta4_
Definition: MCPhotonAnalyzer.h:71
MCPhotonAnalyzer::etaTransformation
float etaTransformation(float a, float b)
Definition: MCPhotonAnalyzer.cc:113
ETA
#define ETA
Definition: GenericBenchmark.cc:28
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
MCPhotonAnalyzer::h_MCPhoEta4_
TH1F * h_MCPhoEta4_
Definition: MCPhotonAnalyzer.h:61
MCPhotonAnalyzer::thePhotonMCTruthFinder_
PhotonMCTruthFinder * thePhotonMCTruthFinder_
Definition: MCPhotonAnalyzer.h:35
MCPhotonAnalyzer::h_MCPhoEta3_
TH1F * h_MCPhoEta3_
Definition: MCPhotonAnalyzer.h:60
ZEcal
static constexpr float ZEcal
Definition: L1TkEmParticleProducer.cc:39
MCPhotonAnalyzer::h_bremEvsEleE_
TH2F * h_bremEvsEleE_
Definition: MCPhotonAnalyzer.h:94
Z_Endcap
static constexpr float Z_Endcap
Definition: ECALPositionCalculator.cc:11
MCPhotonAnalyzer::h_MCConvPhoOneTrackE_
TH1F * h_MCConvPhoOneTrackE_
Conversions with one track.
Definition: MCPhotonAnalyzer.h:83
R_ECAL
static constexpr float R_ECAL
Definition: ECALPositionCalculator.cc:10
vertexPlots.e4
e4
Definition: vertexPlots.py:64
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
etaBarrelEndcap
static constexpr float etaBarrelEndcap
Definition: ECALPositionCalculator.cc:12
MCPhotonAnalyzer::h_MCPhoEta2_
TH1F * h_MCPhoEta2_
Definition: MCPhotonAnalyzer.h:59