21 HepMCLabel(ps.getParameter<
std::
string>(
"moduleLabelMC")),
22 g4InfoLabel(ps.getParameter<
std::
string>(
"moduleLabelG4")),
39 dbe_->showDirStructure();
66 dbe_->setCurrentFolder(
"EcalHitsV/EcalSimHitsValidation");
68 sprintf(histo,
"ES hits layer 1 multiplicity z+");
71 sprintf(histo,
"ES hits layer 2 multiplicity z+");
74 sprintf(histo,
"ES hits layer 1 multiplicity z-");
77 sprintf(histo,
"ES hits layer 2 multiplicity z-");
80 sprintf(histo,
"ES hits energy layer 1 z+");
83 sprintf(histo,
"ES hits energy layer 2 z+");
86 sprintf(histo,
"ES hits energy layer 1 z-");
89 sprintf(histo,
"ES hits energy layer 2 z-");
92 sprintf(histo,
"ES hits log10energy spectrum");
95 sprintf(histo,
"ES hits log10energy spectrum vs normalized energy");
98 sprintf(histo,
"ES E1+07E2 z+");
101 sprintf(histo,
"ES E1+07E2 z-");
104 sprintf(histo,
"EE vs ES z+");
105 meEEoverESzp_ = dbe_->bookProfile(histo, histo, 250, 0., 500., 200, 0., 200.);
107 sprintf(histo,
"EE vs ES z-");
108 meEEoverESzm_ = dbe_->bookProfile(histo, histo, 250, 0., 500., 200, 0., 200.);
110 sprintf(histo,
"ES ene2oEne1 z+");
113 sprintf(histo,
"ES ene2oEne1 z-");
136 std::vector<PCaloHit> theEECaloHits;
138 theEECaloHits.insert(theEECaloHits.end(), EcalHitsEE->begin(), EcalHitsEE->end());
141 std::vector<PCaloHit> theESCaloHits;
143 theESCaloHits.insert(theESCaloHits.end(), EcalHitsES->begin(), EcalHitsES->end());
146 double ESEnergy_ = 0.;
153 for (std::vector<PCaloHit>::iterator isim = theEECaloHits.begin(); isim != theEECaloHits.end(); ++isim) {
155 if (eeid.zside() > 0)
156 EEetzp_ += isim->energy();
157 if (eeid.zside() < 0)
158 EEetzm_ += isim->energy();
161 uint32_t nESHits1zp = 0;
162 uint32_t nESHits1zm = 0;
163 uint32_t nESHits2zp = 0;
164 uint32_t nESHits2zm = 0;
165 double ESet1zp_ = 0.;
166 double ESet2zp_ = 0.;
167 double ESet1zm_ = 0.;
168 double ESet2zm_ = 0.;
169 std::vector<double> econtr(140, 0.);
171 for (std::vector<PCaloHit>::iterator isim = theESCaloHits.begin(); isim != theESCaloHits.end(); ++isim) {
176 LogDebug(
"HitInfo") <<
" CaloHit " << isim->getName() <<
"\n" 177 <<
" DetID = " << isim->id() <<
" ESDetId: z side " << esid.zside() <<
" plane " 178 << esid.plane() << esid.six() <<
',' << esid.siy() <<
':' << esid.strip() <<
"\n" 179 <<
" Time = " << isim->time() <<
"\n" 180 <<
" Track Id = " << isim->geantTrackId() <<
"\n" 181 <<
" Energy = " << isim->energy();
183 ESEnergy_ += isim->energy();
184 if (isim->energy() > 0) {
186 int log10i =
int((log10(isim->energy()) + 10.) * 10.);
187 if (log10i >= 0 && log10i < 140)
188 econtr[log10i] += isim->energy();
191 if (esid.plane() == 1) {
192 if (esid.zside() > 0) {
194 ESet1zp_ += isim->energy();
197 }
else if (esid.zside() < 0) {
199 ESet1zm_ += isim->energy();
203 }
else if (esid.plane() == 2) {
204 if (esid.zside() > 0) {
206 ESet2zp_ += isim->energy();
209 }
else if (esid.zside() < 0) {
211 ESet2zm_ += isim->energy();
229 for (
int i = 0;
i < 140;
i++) {
234 for (HepMC::GenEvent::particle_const_iterator
p = MCEvt->
GetEvent()->particles_begin();
237 double htheta = (*p)->momentum().theta();
238 double heta = -99999.;
239 if (
tan(htheta * 0.5) > 0) {
240 heta = -
log(
tan(htheta * 0.5));
243 if (heta > 1.653 && heta < 2.6) {
251 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.