21 HepMCLabel(ps.getParameter<
std::
string>(
"moduleLabelMC")),
22 g4InfoLabel(ps.getParameter<
std::
string>(
"moduleLabelG4")),
46 dbe_->showDirStructure();
73 dbe_->setCurrentFolder(
"EcalHitsV/EcalSimHitsValidation");
75 sprintf(histo,
"ES hits layer 1 multiplicity z+");
78 sprintf(histo,
"ES hits layer 2 multiplicity z+");
81 sprintf(histo,
"ES hits layer 1 multiplicity z-");
84 sprintf(histo,
"ES hits layer 2 multiplicity z-");
87 sprintf(histo,
"ES hits energy layer 1 z+");
90 sprintf(histo,
"ES hits energy layer 2 z+");
93 sprintf(histo,
"ES hits energy layer 1 z-");
96 sprintf(histo,
"ES hits energy layer 2 z-");
99 sprintf(histo,
"ES hits log10energy spectrum");
102 sprintf(histo,
"ES hits log10energy spectrum vs normalized energy");
105 sprintf(histo,
"ES E1+07E2 z+");
108 sprintf(histo,
"ES E1+07E2 z-");
111 sprintf(histo,
"EE vs ES z+");
112 meEEoverESzp_ = dbe_->bookProfile(histo, histo, 250, 0., 500., 200, 0., 200.);
114 sprintf(histo,
"EE vs ES z-");
115 meEEoverESzm_ = dbe_->bookProfile(histo, histo, 250, 0., 500., 200, 0., 200.);
117 sprintf(histo,
"ES ene2oEne1 z+");
120 sprintf(histo,
"ES ene2oEne1 z-");
143 std::vector<PCaloHit> theEECaloHits;
145 theEECaloHits.insert(theEECaloHits.end(), EcalHitsEE->begin(), EcalHitsEE->end());
148 std::vector<PCaloHit> theESCaloHits;
150 theESCaloHits.insert(theESCaloHits.end(), EcalHitsES->begin(), EcalHitsES->end());
153 double ESEnergy_ = 0.;
160 for (std::vector<PCaloHit>::iterator isim = theEECaloHits.begin(); isim != theEECaloHits.end(); ++isim) {
162 if (eeid.zside() > 0)
163 EEetzp_ += isim->energy();
164 if (eeid.zside() < 0)
165 EEetzm_ += isim->energy();
168 uint32_t nESHits1zp = 0;
169 uint32_t nESHits1zm = 0;
170 uint32_t nESHits2zp = 0;
171 uint32_t nESHits2zm = 0;
172 double ESet1zp_ = 0.;
173 double ESet2zp_ = 0.;
174 double ESet1zm_ = 0.;
175 double ESet2zm_ = 0.;
176 std::vector<double> econtr(140, 0.);
178 for (std::vector<PCaloHit>::iterator isim = theESCaloHits.begin(); isim != theESCaloHits.end(); ++isim) {
183 LogDebug(
"HitInfo") <<
" CaloHit " << isim->getName() <<
"\n" 184 <<
" DetID = " << isim->id() <<
" ESDetId: z side " << esid.zside() <<
" plane " 185 << esid.plane() << esid.six() <<
',' << esid.siy() <<
':' << esid.strip() <<
"\n" 186 <<
" Time = " << isim->time() <<
"\n" 187 <<
" Track Id = " << isim->geantTrackId() <<
"\n" 188 <<
" Energy = " << isim->energy();
190 ESEnergy_ += isim->energy();
191 if (isim->energy() > 0) {
193 int log10i =
int((log10(isim->energy()) + 10.) * 10.);
194 if (log10i >= 0 && log10i < 140)
195 econtr[log10i] += isim->energy();
198 if (esid.plane() == 1) {
199 if (esid.zside() > 0) {
201 ESet1zp_ += isim->energy();
204 }
else if (esid.zside() < 0) {
206 ESet1zm_ += isim->energy();
210 }
else if (esid.plane() == 2) {
211 if (esid.zside() > 0) {
213 ESet2zp_ += isim->energy();
216 }
else if (esid.zside() < 0) {
218 ESet2zm_ += isim->energy();
236 for (
int i = 0;
i < 140;
i++) {
241 for (HepMC::GenEvent::particle_const_iterator
p = MCEvt->
GetEvent()->particles_begin();
244 double htheta = (*p)->momentum().theta();
245 double heta = -99999.;
246 if (
tan(htheta * 0.5) > 0) {
247 heta = -
log(
tan(htheta * 0.5));
250 if (heta > 1.653 && heta < 2.6) {
258 if (heta < -1.653 && heta > -2.6) {
MonitorElement * menESHits1zm_
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
std::string EEHitsCollection
EcalPreshowerSimHitsValidation(const edm::ParameterSet &ps)
Constructor.
MonitorElement * meEShitLog10EnergyNorm_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * me2eszmOver1eszm_
MonitorElement * meEEoverESzm_
MonitorElement * meE1alphaE2zm_
MonitorElement * me2eszpOver1eszp_
void endJob(void) override
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Analyze.
std::string ESHitsCollection
MonitorElement * menESHits2zm_
edm::EDGetTokenT< edm::HepMCProduct > HepMCToken
MonitorElement * meESEnergyHits2zm_
Tan< T >::type tan(const T &t)
MonitorElement * meESEnergyHits1zp_
MonitorElement * menESHits2zp_
Namespace of DDCMS conversion namespace.
MonitorElement * meESEnergyHits1zm_
const HepMC::GenEvent * GetEvent() const
MonitorElement * meE1alphaE2zp_
MonitorElement * meESEnergyHits2zp_
edm::EDGetTokenT< edm::PCaloHitContainer > EEHitsToken
edm::EDGetTokenT< edm::PCaloHitContainer > ESHitsToken
MonitorElement * meEEoverESzp_
MonitorElement * menESHits1zp_
MonitorElement * meEShitLog10Energy_
~EcalPreshowerSimHitsValidation() override
Destructor.