20 HepMCLabel(ps.getParameter<std::
string>(
"moduleLabelMC")),
21 g4InfoLabel(ps.getParameter<std::
string>(
"moduleLabelG4")),
22 EEHitsCollection(ps.getParameter<std::
string>(
"EEHitsCollection")),
23 ESHitsCollection(ps.getParameter<std::
string>(
"ESHitsCollection")){
32 if (
verbose_ ) { dbe_->setVerbose(1); }
33 else { dbe_->setVerbose(0); }
37 if (
verbose_ ) 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-" ) ;
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.;
159 for (std::vector<PCaloHit>::iterator isim = theEECaloHits.begin(); isim != theEECaloHits.end(); ++isim){
161 if (eeid.zside() > 0 ) EEetzp_ += isim->energy();
162 if (eeid.zside() < 0 ) EEetzm_ += isim->energy();
166 uint32_t nESHits1zp = 0;
167 uint32_t nESHits1zm = 0;
168 uint32_t nESHits2zp = 0;
169 uint32_t nESHits2zm = 0;
170 double ESet1zp_ = 0.;
171 double ESet2zp_ = 0.;
172 double ESet1zm_ = 0.;
173 double ESet2zm_ = 0.;
174 std::vector<double> econtr(140, 0. );
176 for (std::vector<PCaloHit>::iterator isim = theESCaloHits.begin();
177 isim != theESCaloHits.end(); ++isim){
183 <<
" CaloHit " << isim->getName() <<
"\n"
184 <<
" DetID = "<<isim->id()<<
" ESDetId: z side " << esid.zside() <<
" plane " << esid.plane() << esid.six() <<
',' << esid.siy() <<
':' << esid.strip() <<
"\n"
185 <<
" Time = " << isim->time() <<
"\n"
186 <<
" Track Id = " << isim->geantTrackId() <<
"\n"
187 <<
" Energy = " << isim->energy();
189 ESEnergy_ += isim->energy();
190 if( isim->energy() > 0 ) {
192 int log10i = int( ( log10(isim->energy()) + 10. ) * 10. );
193 if( log10i >=0 && log10i < 140 ) econtr[log10i] += isim->energy();
196 if (esid.plane() == 1 ) {
197 if (esid.zside() > 0 ) {
199 ESet1zp_ += isim->energy();
202 else if (esid.zside() < 0 ) {
204 ESet1zm_ += isim->energy();
208 else if (esid.plane() == 2 ) {
209 if (esid.zside() > 0 ) {
211 ESet2zp_ += isim->energy();
214 else if (esid.zside() < 0 ) {
216 ESet2zm_ += isim->energy();
230 for(
int i=0;
i<140;
i++ ) {
236 for ( HepMC::GenEvent::particle_const_iterator
p = MCEvt->GetEvent()->particles_begin();
237 p != MCEvt->GetEvent()->particles_end(); ++
p ) {
239 double htheta = (*p)->momentum().theta();
240 double heta = -99999.;
241 if(
tan(htheta * 0.5) > 0 ) {
242 heta = -
log(
tan(htheta * 0.5));
245 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_
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
MonitorElement * me2eszmOver1eszm_
MonitorElement * meEEoverESzm_
MonitorElement * meE1alphaE2zm_
MonitorElement * me2eszpOver1eszp_
std::string ESHitsCollection
MonitorElement * menESHits2zm_
MonitorElement * meESEnergyHits2zm_
Tan< T >::type tan(const T &t)
MonitorElement * meESEnergyHits1zp_
MonitorElement * menESHits2zp_
~EcalPreshowerSimHitsValidation()
Destructor.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * meESEnergyHits1zm_
MonitorElement * meE1alphaE2zp_
MonitorElement * meESEnergyHits2zp_
MonitorElement * meEEoverESzp_
MonitorElement * menESHits1zp_
MonitorElement * meEShitLog10Energy_