67 std::cout <<
"EcalSimple2007H4TBAnalyzer: fetching hitCollection: " << hitCollection_.c_str()
68 <<
" produced by " << hitProducer_.c_str() << std::endl;
118 h_ampltdc =
new TH2F(
"h_ampltdc",
"Max Amplitude vs TDC offset", 100,0.,1.,1000, 0., 4000.);
121 h_tableIsMoving =
new TH1F(
"h_tableIsMoving",
"TableIsMoving", 100000, 0., 100000.);
123 h_e1x1 =
new TH1F(
"h_e1x1",
"E1x1 energy", 1000, 0., 4000.);
124 h_e3x3 =
new TH1F(
"h_e3x3",
"E3x3 energy", 1000, 0., 4000.);
125 h_e5x5 =
new TH1F(
"h_e5x5",
"E5x5 energy", 1000, 0., 4000.);
127 h_e1x1_center =
new TH1F(
"h_e1x1_center",
"E1x1 energy", 1000, 0., 4000.);
128 h_e3x3_center =
new TH1F(
"h_e3x3_center",
"E3x3 energy", 1000, 0., 4000.);
129 h_e5x5_center =
new TH1F(
"h_e5x5_center",
"E5x5 energy", 1000, 0., 4000.);
131 h_e1e9 =
new TH1F(
"h_e1e9",
"E1/E9 ratio", 600, 0., 1.2);
132 h_e1e25 =
new TH1F(
"h_e1e25",
"E1/E25 ratio", 600, 0., 1.2);
133 h_e9e25 =
new TH1F(
"h_e9e25",
"E9/E25 ratio", 600, 0., 1.2);
135 h_S6 =
new TH1F(
"h_S6",
"Amplitude S6", 1000, 0., 4000.);
137 h_bprofx =
new TH1F(
"h_bprofx",
"Beam Profile X",100,-20.,20.);
138 h_bprofy =
new TH1F(
"h_bprofy",
"Beam Profile Y",100,-20.,20.);
140 h_qualx =
new TH1F(
"h_qualx",
"Beam Quality X",5000,0.,5.);
141 h_qualy =
new TH1F(
"h_qualy",
"Beam Quality X",5000,0.,5.);
143 h_slopex =
new TH1F(
"h_slopex",
"Beam Slope X",500, -5
e-4 , 5
e-4 );
144 h_slopey =
new TH1F(
"h_slopey",
"Beam Slope Y",500, -5
e-4 , 5
e-4 );
148 for (
unsigned int icry=0;icry<25;icry++)
150 sprintf(hname,
"h_mapx_%d",icry);
151 sprintf(htitle,
"Max Amplitude vs X %d",icry);
152 h_mapx[icry] =
new TH2F(hname,htitle,80,-20,20,1000,0.,4000.);
153 sprintf(hname,
"h_mapy_%d",icry);
154 sprintf(htitle,
"Max Amplitude vs Y %d",icry);
155 h_mapy[icry] =
new TH2F(hname,htitle,80,-20,20,1000,0.,4000.);
158 h_e1e9_mapx =
new TH2F(
"h_e1e9_mapx",
"E1/E9 vs X",80,-20,20,600,0.,1.2);
159 h_e1e9_mapy =
new TH2F(
"h_e1e9_mapy",
"E1/E9 vs Y",80,-20,20,600,0.,1.2);
161 h_e1e25_mapx =
new TH2F(
"h_e1e25_mapx",
"E1/E25 vs X",80,-20,20,600,0.,1.2);
162 h_e1e25_mapy =
new TH2F(
"h_e1e25_mapy",
"E1/E25 vs Y",80,-20,20,600,0.,1.2);
164 h_e9e25_mapx =
new TH2F(
"h_e9e25_mapx",
"E9/E25 vs X",80,-20,20,600,0.,1.2);
165 h_e9e25_mapy =
new TH2F(
"h_e9e25_mapy",
"E9/E25 vs Y",80,-20,20,600,0.,1.2);
167 h_Shape_ =
new TH2F(
"h_Shape_",
"Xtal in Beam Shape",250,0,10,350,0,3500);
206 for (
unsigned int icry=0;icry<25;icry++)
244 if ( pdigis.isValid() ) {
245 digis = pdigis.product();
256 if (phits.isValid()) {
257 hits = phits.product();
267 if ( pHodo.isValid() ) {
268 recHodo = pHodo.product();
277 if ( pTDC.isValid() ) {
278 recTDC = pTDC.product();
287 if ( pEventHeader.isValid() ) {
288 evtHeader = pEventHeader.product();
318 if (hits->size() == 0)
325 if (evtHeader->tableIsMoving())
343 h_S6->Fill(evtHeader->S6ADC());
349 std::cout<<
"Xtal In Beam is " << xtalInBeam_.
ic() << xtalInBeam_ << std::endl;
350 for (
unsigned int icry=0;icry<25;icry++)
352 unsigned int row = icry / 5;
353 unsigned int column= icry %5;
354 int ix=xtalInBeam_.ix()+row-2;
355 int iy=xtalInBeam_.iy()+column-2;
358 if (tempId.ix()<16 || tempId.ix()>35 || tempId.iy()<51 || tempId.iy()>75)
366 const TruncatedPyramid* tp ( dynamic_cast<const TruncatedPyramid*>(cell) ) ;
367 std::cout <<
"** Xtal in the matrix **** row " << row <<
", column " << column <<
", xtal " <<
Xtals5x5[icry] <<
" Position " << tp->getPosition(0.) << std::endl;
376 if (evtHeader->tableIsMoving())
378 std::cout <<
"Table is moving" << std::endl;
386 float maxHit= -999999.;
389 if (ithit->amplitude()>=maxHit)
391 maxHit=ithit->amplitude();
392 maxHitId=ithit->id();
398 std::cout <<
"No maxHit found" << std::endl;
404 double samples_save[10];
for(
int i=0;
i < 10; ++
i) samples_save[
i]=0.0;
417 samples_save[
sample] = analogSample;
419 if ( eMax < analogSample )
427 for(
int i =0;
i < 10; ++
i)
428 h_Shape_->Fill(
double(
i)+recTDC->offset(),samples_save[
i]);
433 double amplitude[25];
434 double amplitude3x3=0;
435 double amplitude5x5=0;
436 for (
unsigned int icry=0;icry<25;icry++)
440 amplitude[icry]=(hits->find(
Xtals5x5[icry]))->amplitude();
441 amplitude5x5 += amplitude[icry];
443 if ( icry == 6 || icry == 7 || icry == 8 ||
444 icry == 11 || icry == 12 || icry ==13 ||
445 icry == 16 || icry == 17 || icry ==18 )
447 amplitude3x3+=amplitude[icry];
453 h_e1x1->Fill(amplitude[12]);
454 h_e3x3->Fill(amplitude3x3);
455 h_e5x5->Fill(amplitude5x5);
457 h_e1e9->Fill(amplitude[12]/amplitude3x3);
458 h_e1e25->Fill(amplitude[12]/amplitude5x5);
459 h_e9e25->Fill(amplitude3x3/amplitude5x5);
463 h_ampltdc->Fill(recTDC->offset(),amplitude[12]);
468 float x=recHodo->posX();
469 float y=recHodo->posY();
470 float xslope=recHodo->slopeX();
471 float yslope=recHodo->slopeY();
472 float xqual=recHodo->qualX();
473 float yqual=recHodo->qualY();
486 if ( fabs(x + 2.5) < 2.5 && fabs(y + 0.5) < 2.5)
493 for (
unsigned int icry=0;icry<25;icry++)
495 h_mapx[icry]->Fill(x,amplitude[icry]);
496 h_mapy[icry]->Fill(y,amplitude[icry]);
const CaloGeometry * theTBGeometry_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
std::string eventHeaderCollection_
std::vector< EcalUncalibratedRecHit >::const_iterator const_iterator
EcalMGPASample sample(int i) const
std::string tdcRecInfoCollection_
std::string tdcRecInfoProducer_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
int ic() const
get ECAL/crystal number inside SM
std::string digiCollection_
~EcalSimple2007H4TBAnalyzer()
EcalSimple2007H4TBAnalyzer(const edm::ParameterSet &)
bool null() const
is this a null id ?
std::string hitCollection_
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code...
const CaloCellGeometry * getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
virtual void analyze(edm::Event const &, edm::EventSetup const &)
std::string hodoRecInfoCollection_
std::string hodoRecInfoProducer_
std::string digiProducer_
std::string eventHeaderProducer_
static const int SMCRYSTALMODE
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
int adc() const
get the ADC sample (12 bits)
int zside() const
get the z-side of the crystal (1/-1)