37 : rootfile_(iConfig.getUntrackedParameter<std::
string>(
"rootfile",
"ecalSimpleTBanalysis.root")),
38 digiCollection_(iConfig.getParameter<std::
string>(
"digiCollection")),
39 digiProducer_(iConfig.getParameter<std::
string>(
"digiProducer")),
40 hitCollection_(iConfig.getParameter<std::
string>(
"hitCollection")),
41 hitProducer_(iConfig.getParameter<std::
string>(
"hitProducer")),
42 hodoRecInfoCollection_(iConfig.getParameter<std::
string>(
"hodoRecInfoCollection")),
43 hodoRecInfoProducer_(iConfig.getParameter<std::
string>(
"hodoRecInfoProducer")),
44 tdcRecInfoCollection_(iConfig.getParameter<std::
string>(
"tdcRecInfoCollection")),
45 tdcRecInfoProducer_(iConfig.getParameter<std::
string>(
"tdcRecInfoProducer")),
46 eventHeaderCollection_(iConfig.getParameter<std::
string>(
"eventHeaderCollection")),
47 eventHeaderProducer_(iConfig.getParameter<std::
string>(
"eventHeaderProducer")),
48 eeDigiToken_(consumes<>(edm::
InputTag(digiProducer_, digiCollection_))),
49 eeUncalibratedRecHitToken_(consumes<>(edm::
InputTag(hitProducer_, hitCollection_))),
50 tbHodoscopeRecInfoToken_(consumes<>(edm::
InputTag(hodoRecInfoProducer_, hodoRecInfoCollection_))),
51 tbTDCRecInfoToken_(consumes<>(edm::
InputTag(tdcRecInfoProducer_, tdcRecInfoCollection_))),
52 tbEventHeaderToken_(consumes<>(edm::
InputTag(eventHeaderProducer_))),
59 <<
"EcalSimple2007H4TBAnalyzer: fetching hitCollection: " <<
hitCollection_.c_str() <<
" produced by "
98 h_ampltdc =
new TH2F(
"h_ampltdc",
"Max Amplitude vs TDC offset", 100, 0., 1., 1000, 0., 4000.);
101 h_tableIsMoving =
new TH1F(
"h_tableIsMoving",
"TableIsMoving", 100000, 0., 100000.);
103 h_e1x1 =
new TH1F(
"h_e1x1",
"E1x1 energy", 1000, 0., 4000.);
104 h_e3x3 =
new TH1F(
"h_e3x3",
"E3x3 energy", 1000, 0., 4000.);
105 h_e5x5 =
new TH1F(
"h_e5x5",
"E5x5 energy", 1000, 0., 4000.);
107 h_e1x1_center =
new TH1F(
"h_e1x1_center",
"E1x1 energy", 1000, 0., 4000.);
108 h_e3x3_center =
new TH1F(
"h_e3x3_center",
"E3x3 energy", 1000, 0., 4000.);
109 h_e5x5_center =
new TH1F(
"h_e5x5_center",
"E5x5 energy", 1000, 0., 4000.);
111 h_e1e9 =
new TH1F(
"h_e1e9",
"E1/E9 ratio", 600, 0., 1.2);
112 h_e1e25 =
new TH1F(
"h_e1e25",
"E1/E25 ratio", 600, 0., 1.2);
113 h_e9e25 =
new TH1F(
"h_e9e25",
"E9/E25 ratio", 600, 0., 1.2);
115 h_S6 =
new TH1F(
"h_S6",
"Amplitude S6", 1000, 0., 4000.);
117 h_bprofx =
new TH1F(
"h_bprofx",
"Beam Profile X", 100, -20., 20.);
118 h_bprofy =
new TH1F(
"h_bprofy",
"Beam Profile Y", 100, -20., 20.);
120 h_qualx =
new TH1F(
"h_qualx",
"Beam Quality X", 5000, 0., 5.);
121 h_qualy =
new TH1F(
"h_qualy",
"Beam Quality X", 5000, 0., 5.);
123 h_slopex =
new TH1F(
"h_slopex",
"Beam Slope X", 500, -5
e-4, 5
e-4);
124 h_slopey =
new TH1F(
"h_slopey",
"Beam Slope Y", 500, -5
e-4, 5
e-4);
128 for (
unsigned int icry = 0; icry < 25; icry++) {
129 sprintf(hname,
"h_mapx_%d", icry);
130 sprintf(htitle,
"Max Amplitude vs X %d", icry);
131 h_mapx[icry] =
new TH2F(hname, htitle, 80, -20, 20, 1000, 0., 4000.);
132 sprintf(hname,
"h_mapy_%d", icry);
133 sprintf(htitle,
"Max Amplitude vs Y %d", icry);
134 h_mapy[icry] =
new TH2F(hname, htitle, 80, -20, 20, 1000, 0., 4000.);
137 h_e1e9_mapx =
new TH2F(
"h_e1e9_mapx",
"E1/E9 vs X", 80, -20, 20, 600, 0., 1.2);
138 h_e1e9_mapy =
new TH2F(
"h_e1e9_mapy",
"E1/E9 vs Y", 80, -20, 20, 600, 0., 1.2);
140 h_e1e25_mapx =
new TH2F(
"h_e1e25_mapx",
"E1/E25 vs X", 80, -20, 20, 600, 0., 1.2);
141 h_e1e25_mapy =
new TH2F(
"h_e1e25_mapy",
"E1/E25 vs Y", 80, -20, 20, 600, 0., 1.2);
143 h_e9e25_mapx =
new TH2F(
"h_e9e25_mapx",
"E9/E25 vs X", 80, -20, 20, 600, 0., 1.2);
144 h_e9e25_mapy =
new TH2F(
"h_e9e25_mapy",
"E9/E25 vs Y", 80, -20, 20, 600, 0., 1.2);
146 h_Shape_ =
new TH2F(
"h_Shape_",
"Xtal in Beam Shape", 250, 0, 10, 350, 0, 3500);
187 for (
unsigned int icry = 0; icry < 25; icry++) {
220 if (pdigis.isValid()) {
221 digis = pdigis.product();
230 if (
phits.isValid()) {
231 hits =
phits.product();
239 if (pHodo.isValid()) {
240 recHodo = pHodo.product();
248 if (pTDC.isValid()) {
249 recTDC = pTDC.product();
257 if (pEventHeader.isValid()) {
258 evtHeader = pEventHeader.product();
284 if (evtHeader->tableIsMoving())
288 h_S6->Fill(evtHeader->S6ADC());
294 for (
unsigned int icry = 0; icry < 25; icry++) {
295 unsigned int row = icry / 5;
296 unsigned int column = icry % 5;
297 int ix = xtalInBeam_.ix() + row - 2;
298 int iy = xtalInBeam_.iy() + column - 2;
301 if (tempId.ix() < 16 || tempId.ix() > 35 || tempId.iy() < 51 || tempId.iy() > 75)
309 <<
"** Xtal in the matrix **** row " << row <<
", column " << column <<
", xtal " <<
Xtals5x5[icry]
310 <<
" Position " << cell->getPosition(0.);
318 if (evtHeader->tableIsMoving()) {
325 float maxHit = -999999.;
327 if (ithit->amplitude() >= maxHit) {
328 maxHit = ithit->amplitude();
329 maxHitId = ithit->id();
338 double samples_save[10];
339 for (
int i = 0;
i < 10; ++
i)
340 samples_save[
i] = 0.0;
350 samples_save[
sample] = analogSample;
351 if (eMax < analogSample) {
357 for (
int i = 0;
i < 10; ++
i)
358 h_Shape_->Fill(
double(
i) + recTDC->offset(), samples_save[
i]);
361 double amplitude[25];
362 double amplitude3x3 = 0;
363 double amplitude5x5 = 0;
364 for (
unsigned int icry = 0; icry < 25; icry++) {
366 amplitude[icry] = (hits->find(
Xtals5x5[icry]))->amplitude();
367 amplitude5x5 += amplitude[icry];
369 if (icry == 6 || icry == 7 || icry == 8 || icry == 11 || icry == 12 || icry == 13 || icry == 16 || icry == 17 ||
371 amplitude3x3 += amplitude[icry];
377 h_e1x1->Fill(amplitude[12]);
378 h_e3x3->Fill(amplitude3x3);
379 h_e5x5->Fill(amplitude5x5);
381 h_e1e9->Fill(amplitude[12] / amplitude3x3);
382 h_e1e25->Fill(amplitude[12] / amplitude5x5);
383 h_e9e25->Fill(amplitude3x3 / amplitude5x5);
387 h_ampltdc->Fill(recTDC->offset(), amplitude[12]);
391 float x = recHodo->posX();
392 float y = recHodo->posY();
393 float xslope = recHodo->slopeX();
394 float yslope = recHodo->slopeY();
395 float xqual = recHodo->qualX();
396 float yqual = recHodo->qualY();
408 if (fabs(x + 2.5) < 2.5 && fabs(y + 0.5) < 2.5) {
414 for (
unsigned int icry = 0; icry < 25; icry++) {
415 h_mapx[icry]->Fill(x, amplitude[icry]);
416 h_mapy[icry]->Fill(y, amplitude[icry]);
419 h_e1e9_mapx->Fill(x, amplitude[12] / amplitude3x3);
420 h_e1e9_mapy->Fill(y, amplitude[12] / amplitude3x3);
Log< level::Info, true > LogVerbatim
const CaloGeometry * theTBGeometry_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
const edm::EDGetTokenT< EcalTBTDCRecInfo > tbTDCRecInfoToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
constexpr bool null() const
is this a null id ?
void beginRun(edm::Run const &, edm::EventSetup const &) override
const std::string hitProducer_
std::vector< T >::const_iterator const_iterator
EcalMGPASample sample(int i) const
const edm::EDGetTokenT< EEDigiCollection > eeDigiToken_
const edm::EDGetTokenT< EEUncalibratedRecHitCollection > eeUncalibratedRecHitToken_
const std::string digiCollection_
Log< level::Error, false > LogError
const edm::EDGetTokenT< EcalTBHodoscopeRecInfo > tbHodoscopeRecInfoToken_
const edm::EDGetTokenT< EcalTBEventHeader > tbEventHeaderToken_
bool getData(T &iHolder) const
const std::string hitCollection_
const std::string tdcRecInfoCollection_
const std::string hodoRecInfoCollection_
~EcalSimple2007H4TBAnalyzer() override
void analyze(edm::Event const &, edm::EventSetup const &) override
int ic() const
get ECAL/crystal number inside SM
EcalSimple2007H4TBAnalyzer(const edm::ParameterSet &)
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
static const int SMCRYSTALMODE
void endRun(edm::Run const &, edm::EventSetup const &) override
const std::string rootfile_
const std::string eventHeaderProducer_
caConstants::TupleMultiplicity const *__restrict__ HitsOnGPU const *__restrict__ tindex_type *__restrict__ double *__restrict__ phits
int adc() const
get the ADC sample (12 bits)
int zside() const
get the z-side of the crystal (1/-1)