14 EBRecHitCollection_ = iConfig.
getParameter<std::string>(
"EBRecHitCollection");
15 RecHitProducer_ = iConfig.
getParameter<std::string>(
"RecHitProducer");
16 hodoRecInfoCollection_ = iConfig.
getParameter<std::string>(
"hodoRecInfoCollection");
17 hodoRecInfoProducer_ = iConfig.
getParameter<std::string>(
"hodoRecInfoProducer");
18 tdcRecInfoCollection_ = iConfig.
getParameter<std::string>(
"tdcRecInfoCollection");
19 tdcRecInfoProducer_ = iConfig.
getParameter<std::string>(
"tdcRecInfoProducer");
20 eventHeaderCollection_ = iConfig.
getParameter<std::string>(
"eventHeaderCollection");
21 eventHeaderProducer_ = iConfig.
getParameter<std::string>(
"eventHeaderProducer");
25 cout <<
"Constructor" << endl;
27 cout <<
"TreeProducerCalibSimul" << endl;
29 cout <<
"Fetching hitCollection: " << EBRecHitCollection_.c_str() <<
" prod by " << RecHitProducer_.c_str() <<endl;
30 cout <<
"Fetching hodoCollection: " << hodoRecInfoCollection_.c_str() <<
" prod by " << hodoRecInfoProducer_.c_str() <<endl;
31 cout <<
"Fetching tdcCollection: " << tdcRecInfoCollection_.c_str() <<
" prod by " << tdcRecInfoProducer_.c_str() <<endl;
32 cout <<
"Fetching evHeaCollection: " << eventHeaderCollection_.c_str() <<
" prod by " << eventHeaderProducer_.c_str() <<endl;
42 cout <<
"Deleting" << endl;
55 cout <<
"BeginJob" << endl;
77 cout <<
"EndJob" << endl;
80 ofstream *MyOut =
new ofstream(txtfile_.c_str());
81 *MyOut <<
"total events: " << tot_events << endl;
82 *MyOut <<
"events skipped because of no hits: " << noHits << endl;
83 *MyOut <<
"events skipped because of no hodos: " << noHodo << endl;
84 *MyOut <<
"events skipped because of no tdc: " << noTdc << endl;
85 *MyOut <<
"events skipped because of no header: " << noHeader << endl;
86 *MyOut <<
"total OK events (passing the basic selection): " << tot_events_ok << endl;
103 if ( tot_events%5000 == 0){
cout <<
"event " << tot_events << endl;}
111 iEvent.
getByLabel (RecHitProducer_, EBRecHitCollection_, pEBRecHits) ;
114 std::cout <<
"Error! can't get the product " << EBRecHitCollection_.c_str () << std::endl ;
115 std::cerr <<
"Error! can't get the product " << EBRecHitCollection_.c_str () << std::endl ;
122 iEvent.
getByLabel( hodoRecInfoProducer_, hodoRecInfoCollection_, pHodo);
123 recHodo = pHodo.product();
125 std::cout <<
"Error! can't get the product " << hodoRecInfoCollection_.c_str() << std::endl;
126 std::cerr <<
"Error! can't get the product " << hodoRecInfoCollection_.c_str() << std::endl;
133 iEvent.
getByLabel( tdcRecInfoProducer_, tdcRecInfoCollection_, pTDC);
134 recTDC = pTDC.product();
136 std::cout <<
"Error! can't get the product " << tdcRecInfoCollection_.c_str() << std::endl;
137 std::cerr <<
"Error! can't get the product " << tdcRecInfoCollection_.c_str() << std::endl;
144 iEvent.
getByLabel( eventHeaderProducer_ , pEventHeader );
145 evtHeader = pEventHeader.product();
147 std::cout <<
"Error! can't get the event header " <<std::endl;
148 std::cerr <<
"Error! can't get the event header " <<std::endl;
153 if (!recTDC) { noTdc++;
return; }
154 if (!recHodo) { noHodo++;
return; }
155 if (!evtHeader) { noHeader++;
return; }
164 int event = evtHeader->eventNumber();
168 int nomXtalInBeam = -999;
169 int nextXtalInBeam = -999;
172 if (xtalInBeamId==
EBDetId(0)){
return; }
173 int mySupCry = xtalInBeamId.
ic();
174 int mySupEta = xtalInBeamId.
ieta();
175 int mySupPhi = xtalInBeamId.
iphi();
180 double x = recHodo->posX();
181 double y = recHodo->posY();
182 double sx = recHodo->slopeX();
183 double sy = recHodo->slopeY();
184 double qx = recHodo->qualX();
185 double qy = recHodo->qualY();
190 double tdcOffset = recTDC->offset();
199 for (
unsigned int icry=0; icry<49; icry++){
200 unsigned int row = icry/7;
201 unsigned int column = icry%7;
206 if ( Xtals7x7[icry].
ism() == 1){
208 crystal[icry] = Xtals7x7[icry].ic();
210 if ( Xtals7x7[icry].
ism() != 1){
212 crystal[icry] = -100;
220 crystal[icry] = -100;
228 double maxEne = -999.;
229 int maxEneCry = 9999;
230 int maxEneInMatrix = -999;
231 for (
int ii=0; ii<49; ii++){
if (
energy[ii] > maxEne){
233 maxEneCry = crystal[ii];
234 maxEneInMatrix = ii;}
244 myTree->fillInfo(
run,
event, mySupCry, maxEneCry, nomXtalInBeam, nextXtalInBeam, mySupEta, mySupPhi, tbm,
x,
y, Xcal, Ycal, sx, sy, qx, qy, tdcOffset, allMatrix,
energy, crystal);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
TreeProducerCalibSimul(const edm::ParameterSet &)
int iphi() const
get the crystal iphi
~TreeProducerCalibSimul()
int ieta() const
get the crystal ieta
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
static const int ETAPHIMODE
int ic() const
get ECAL/crystal number inside SM
virtual void analyze(const edm::Event &, const edm::EventSetup &)
static const int SMCRYSTALMODE
int ism(int ieta, int iphi)