CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
EcalSimple2007H4TBAnalyzer Class Reference

#include <EcalSimple2007H4TBAnalyzer.h>

Inheritance diagram for EcalSimple2007H4TBAnalyzer:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &, edm::EventSetup const &) override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 EcalSimple2007H4TBAnalyzer (const edm::ParameterSet &)
 
void endJob () override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
 ~EcalSimple2007H4TBAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

const std::string digiCollection_
 
const std::string digiProducer_
 
const edm::EDGetTokenT< EEDigiCollectioneeDigiToken_
 
const edm::EDGetTokenT< EEUncalibratedRecHitCollectioneeUncalibratedRecHitToken_
 
const std::string eventHeaderCollection_
 
const std::string eventHeaderProducer_
 
const edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeometryToken_
 
TH2F * h_ampltdc
 
TH1F * h_bprofx
 
TH1F * h_bprofy
 
TH1F * h_e1e25
 
TH2F * h_e1e25_mapx
 
TH2F * h_e1e25_mapy
 
TH1F * h_e1e9
 
TH2F * h_e1e9_mapx
 
TH2F * h_e1e9_mapy
 
TH1F * h_e1x1
 
TH1F * h_e1x1_center
 
TH1F * h_e3x3
 
TH1F * h_e3x3_center
 
TH1F * h_e5x5
 
TH1F * h_e5x5_center
 
TH1F * h_e9e25
 
TH2F * h_e9e25_mapx
 
TH2F * h_e9e25_mapy
 
TH2F * h_mapx [25]
 
TH2F * h_mapy [25]
 
TH1F * h_qualx
 
TH1F * h_qualy
 
TH1F * h_S6
 
TH2F * h_Shape_
 
TH1F * h_slopex
 
TH1F * h_slopey
 
TH1F * h_tableIsMoving
 
const std::string hitCollection_
 
const std::string hitProducer_
 
const std::string hodoRecInfoCollection_
 
const std::string hodoRecInfoProducer_
 
const std::string rootfile_
 
const edm::EDGetTokenT< EcalTBEventHeadertbEventHeaderToken_
 
const edm::EDGetTokenT< EcalTBHodoscopeRecInfotbHodoscopeRecInfoToken_
 
const edm::EDGetTokenT< EcalTBTDCRecInfotbTDCRecInfoToken_
 
const std::string tdcRecInfoCollection_
 
const std::string tdcRecInfoProducer_
 
const CaloGeometrytheTBGeometry_
 
EEDetId xtalInBeam_
 
EBDetId xtalInBeamTmp
 
EEDetId Xtals5x5 [25]
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 43 of file EcalSimple2007H4TBAnalyzer.h.

Constructor & Destructor Documentation

◆ EcalSimple2007H4TBAnalyzer()

EcalSimple2007H4TBAnalyzer::EcalSimple2007H4TBAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 36 of file EcalSimple2007H4TBAnalyzer.cc.

References hitCollection_, and hitProducer_.

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")),
53  geometryToken_(esConsumes<edm::Transition::BeginRun>()),
54  xtalInBeam_(0)
55 //========================================================================
56 {
57  //now do what ever initialization is needed
58  edm::LogVerbatim("EcalSimple2007H4TBAnalyzer")
59  << "EcalSimple2007H4TBAnalyzer: fetching hitCollection: " << hitCollection_.c_str() << " produced by "
60  << hitProducer_.c_str();
61 }
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
const edm::EDGetTokenT< EcalTBTDCRecInfo > tbTDCRecInfoToken_
const edm::EDGetTokenT< EEDigiCollection > eeDigiToken_
const edm::EDGetTokenT< EEUncalibratedRecHitCollection > eeUncalibratedRecHitToken_
const edm::EDGetTokenT< EcalTBHodoscopeRecInfo > tbHodoscopeRecInfoToken_
const edm::EDGetTokenT< EcalTBEventHeader > tbEventHeaderToken_
T getUntrackedParameter(std::string const &, T const &) const

◆ ~EcalSimple2007H4TBAnalyzer()

EcalSimple2007H4TBAnalyzer::~EcalSimple2007H4TBAnalyzer ( )
override

Definition at line 64 of file EcalSimple2007H4TBAnalyzer.cc.

66 {
67  // do anything here that needs to be done at desctruction time
68  // (e.g. close files, deallocate resources etc.)
69  // Amplitude vs TDC offset
70  // if (h_ampltdc)
71  // delete h_ampltdc;
72 
73  // // Reconstructed energies
74  // delete h_e1x1;
75  // delete h_e3x3;
76  // delete h_e5x5;
77 
78  // delete h_bprofx;
79  // delete h_bprofy;
80 
81  // delete h_qualx;
82  // delete h_qualy;
83 
84  // delete h_slopex;
85  // delete h_slopey;
86 
87  // delete h_mapx;
88  // delete h_mapy;
89 }

Member Function Documentation

◆ analyze()

void EcalSimple2007H4TBAnalyzer::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 211 of file EcalSimple2007H4TBAnalyzer.cc.

References EcalMGPASample::adc(), CustomPhysics_cfi::amplitude, edm::DataFrameContainer::begin(), EcalTBEventHeader::crystalInBeam(), digiCollection_, eeDigiToken_, eeUncalibratedRecHitToken_, cosmicPhotonAnalyzer_cfi::eMax, edm::DataFrameContainer::end(), eventHeaderProducer_, EcalTBEventHeader::eventNumber(), CaloGeometry::getGeometry(), h_ampltdc, h_bprofx, h_bprofy, h_e1e25, h_e1e25_mapx, h_e1e25_mapy, h_e1e9, h_e1e9_mapx, h_e1e9_mapy, h_e1x1, h_e1x1_center, h_e3x3, h_e3x3_center, h_e5x5, h_e5x5_center, h_e9e25, h_e9e25_mapx, h_e9e25_mapy, h_mapx, h_mapy, h_qualx, h_qualy, h_S6, h_Shape_, h_slopex, h_slopey, h_tableIsMoving, hitCollection_, hfClusterShapes_cfi::hits, hodoRecInfoCollection_, mps_fire::i, EBDetId::ic(), EEDetId::ic(), iEvent, createfilelist::int, edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), MTVHistoProducerAlgoForTrackerBlock_cfi::maxHit, DetId::null(), EcalTBTDCRecInfo::offset(), phits, EcalTBHodoscopeRecInfo::posX(), EcalTBHodoscopeRecInfo::posY(), edm::Handle< T >::product(), EcalTBHodoscopeRecInfo::qualX(), EcalTBHodoscopeRecInfo::qualY(), EcalTBEventHeader::S6ADC(), EcalDataFrame::sample(), ecalGpuTask_cfi::sample, EcalDataFrame::size(), EcalTBHodoscopeRecInfo::slopeX(), EcalTBHodoscopeRecInfo::slopeY(), EBDetId::SMCRYSTALMODE, EcalTBEventHeader::tableIsMoving(), tbEventHeaderToken_, tbHodoscopeRecInfoToken_, tbTDCRecInfoToken_, tdcRecInfoCollection_, theTBGeometry_, x, xtalInBeam_, xtalInBeamTmp, Xtals5x5, y, and EEDetId::zside().

211  {
212  //========================================================================
213 
214  using namespace edm;
215  using namespace cms;
216 
218  const EEDigiCollection* digis = nullptr;
219  iEvent.getByToken(eeDigiToken_, pdigis);
220  if (pdigis.isValid()) {
221  digis = pdigis.product(); // get a ptr to the product
222  } else {
223  edm::LogError("EcalSimple2007H4TBAnalyzerError") << "Error! can't get the product " << digiCollection_;
224  }
225 
226  // fetch the digis and compute signal amplitude
228  const EEUncalibratedRecHitCollection* hits = nullptr;
230  if (phits.isValid()) {
231  hits = phits.product(); // get a ptr to the product
232  } else {
233  edm::LogError("EcalSimple2007H4TBAnalyzerError") << "Error! can't get the product " << hitCollection_;
234  }
235 
237  const EcalTBHodoscopeRecInfo* recHodo = nullptr;
238  iEvent.getByToken(tbHodoscopeRecInfoToken_, pHodo);
239  if (pHodo.isValid()) {
240  recHodo = pHodo.product(); // get a ptr to the product
241  } else {
242  edm::LogError("EcalSimple2007H4TBAnalyzerError") << "Error! can't get the product " << hodoRecInfoCollection_;
243  }
244 
246  const EcalTBTDCRecInfo* recTDC = nullptr;
247  iEvent.getByToken(tbTDCRecInfoToken_, pTDC);
248  if (pTDC.isValid()) {
249  recTDC = pTDC.product(); // get a ptr to the product
250  } else {
251  edm::LogError("EcalSimple2007H4TBAnalyzerError") << "Error! can't get the product " << tdcRecInfoCollection_;
252  }
253 
254  Handle<EcalTBEventHeader> pEventHeader;
255  const EcalTBEventHeader* evtHeader = nullptr;
256  iEvent.getByToken(tbEventHeaderToken_, pEventHeader);
257  if (pEventHeader.isValid()) {
258  evtHeader = pEventHeader.product(); // get a ptr to the product
259  } else {
260  edm::LogError("EcalSimple2007H4TBAnalyzerError") << "Error! can't get the product " << eventHeaderProducer_;
261  }
262 
263  if (!hits) {
264  return;
265  }
266 
267  if (!recTDC) {
268  return;
269  }
270 
271  if (!recHodo) {
272  return;
273  }
274 
275  if (!evtHeader) {
276  return;
277  }
278 
279  if (hits->empty()) {
280  return;
281  }
282 
283  //Accessing various event information
284  if (evtHeader->tableIsMoving())
285  h_tableIsMoving->Fill(evtHeader->eventNumber());
286 
287  //S6 beam scintillator
288  h_S6->Fill(evtHeader->S6ADC());
289 
290  if (xtalInBeamTmp.null()) {
292  xtalInBeam_ = EEDetId(35 - ((xtalInBeamTmp.ic() - 1) % 20), int(int(xtalInBeamTmp.ic()) / int(20)) + 51, -1);
293  edm::LogVerbatim("EcalSimple2007H4TBAnalyzer") << "Xtal In Beam is " << xtalInBeam_.ic() << xtalInBeam_;
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;
299  EEDetId tempId(ix, iy, xtalInBeam_.zside());
300  //Selecting matrix of xtals used in 2007H4TB
301  if (tempId.ix() < 16 || tempId.ix() > 35 || tempId.iy() < 51 || tempId.iy() > 75)
302  Xtals5x5[icry] = EEDetId(0);
303  else {
304  Xtals5x5[icry] = tempId;
305  auto cell = theTBGeometry_->getGeometry(Xtals5x5[icry]);
306  if (!cell)
307  continue;
308  edm::LogVerbatim("EcalSimple2007H4TBAnalyzer")
309  << "** Xtal in the matrix **** row " << row << ", column " << column << ", xtal " << Xtals5x5[icry]
310  << " Position " << cell->getPosition(0.);
311  }
312  }
313  } else if (xtalInBeamTmp !=
314  EBDetId(1, evtHeader->crystalInBeam(), EBDetId::SMCRYSTALMODE)) //run analysis only on first xtal in beam
315  return;
316 
317  //Avoid moving table events
318  if (evtHeader->tableIsMoving()) {
319  edm::LogVerbatim("EcalSimple2007H4TBAnalyzer") << "Table is moving";
320  return;
321  }
322 
323  // Searching for max amplitude xtal alternative to use xtalInBeam_
324  EEDetId maxHitId(0);
325  float maxHit = -999999.;
326  for (EEUncalibratedRecHitCollection::const_iterator ithit = hits->begin(); ithit != hits->end(); ++ithit) {
327  if (ithit->amplitude() >= maxHit) {
328  maxHit = ithit->amplitude();
329  maxHitId = ithit->id();
330  }
331  }
332  if (maxHitId == EEDetId(0)) {
333  edm::LogVerbatim("EcalSimple2007H4TBAnalyzer") << "No maxHit found";
334  return;
335  }
336 
337  //Filling the digis shape for the xtalInBeam
338  double samples_save[10];
339  for (int i = 0; i < 10; ++i)
340  samples_save[i] = 0.0;
341 
342  double eMax = 0.;
343  for (EEDigiCollection::const_iterator digiItr = digis->begin(); digiItr != digis->end(); ++digiItr) {
344  if (EEDetId((*digiItr).id()) != xtalInBeam_)
345  continue;
346 
347  EEDataFrame myDigi = (*digiItr);
348  for (int sample = 0; sample < myDigi.size(); ++sample) {
349  double analogSample = myDigi.sample(sample).adc();
350  samples_save[sample] = analogSample;
351  if (eMax < analogSample) {
352  eMax = analogSample;
353  }
354  }
355  }
356 
357  for (int i = 0; i < 10; ++i)
358  h_Shape_->Fill(double(i) + recTDC->offset(), samples_save[i]);
359 
360  // Taking amplitudes in 5x5
361  double amplitude[25];
362  double amplitude3x3 = 0;
363  double amplitude5x5 = 0;
364  for (unsigned int icry = 0; icry < 25; icry++) {
365  if (!Xtals5x5[icry].null()) {
366  amplitude[icry] = (hits->find(Xtals5x5[icry]))->amplitude();
367  amplitude5x5 += amplitude[icry];
368  // Is in 3x3?
369  if (icry == 6 || icry == 7 || icry == 8 || icry == 11 || icry == 12 || icry == 13 || icry == 16 || icry == 17 ||
370  icry == 18) {
371  amplitude3x3 += amplitude[icry];
372  }
373  }
374  }
375 
376  //Filling amplitudes
377  h_e1x1->Fill(amplitude[12]);
378  h_e3x3->Fill(amplitude3x3);
379  h_e5x5->Fill(amplitude5x5);
380 
381  h_e1e9->Fill(amplitude[12] / amplitude3x3);
382  h_e1e25->Fill(amplitude[12] / amplitude5x5);
383  h_e9e25->Fill(amplitude3x3 / amplitude5x5);
384 
385  //Checking stability of amplitude vs TDC
386  if (recTDC)
387  h_ampltdc->Fill(recTDC->offset(), amplitude[12]);
388 
389  //Various amplitudes as a function of hodoscope coordinates
390  if (recHodo) {
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();
397 
398  //Filling beam profiles
399  h_bprofx->Fill(x);
400  h_bprofy->Fill(y);
401  h_qualx->Fill(xqual);
402  h_qualy->Fill(yqual);
403  h_slopex->Fill(xslope);
404  h_slopey->Fill(yslope);
405 
406  //Fill central events
407 
408  if (fabs(x + 2.5) < 2.5 && fabs(y + 0.5) < 2.5) {
409  h_e1x1_center->Fill(amplitude[12]);
410  h_e3x3_center->Fill(amplitude3x3);
411  h_e5x5_center->Fill(amplitude5x5);
412  }
413 
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]);
417  }
418 
419  h_e1e9_mapx->Fill(x, amplitude[12] / amplitude3x3);
420  h_e1e9_mapy->Fill(y, amplitude[12] / amplitude3x3);
421 
422  h_e1e25_mapx->Fill(x, amplitude[12] / amplitude5x5);
423  h_e1e25_mapy->Fill(y, amplitude[12] / amplitude5x5);
424 
425  h_e9e25_mapx->Fill(x, amplitude3x3 / amplitude5x5);
426  h_e9e25_mapy->Fill(y, amplitude3x3 / amplitude5x5);
427  }
428 }
Log< level::Info, true > LogVerbatim
int crystalInBeam() const
Returns the crystal which is being hit by the beam (in the internal SM numbering scheme) ...
const edm::EDGetTokenT< EcalTBTDCRecInfo > tbTDCRecInfoToken_
T const * product() const
Definition: Handle.h:70
int ix() const
Definition: EEDetId.h:77
std::vector< T >::const_iterator const_iterator
const edm::EDGetTokenT< EEDigiCollection > eeDigiToken_
const edm::EDGetTokenT< EEUncalibratedRecHitCollection > eeUncalibratedRecHitToken_
Log< level::Error, false > LogError
const edm::EDGetTokenT< EcalTBHodoscopeRecInfo > tbHodoscopeRecInfoToken_
const edm::EDGetTokenT< EcalTBEventHeader > tbEventHeaderToken_
int ic() const
Definition: EEDetId.cc:245
int size() const
Definition: EcalDataFrame.h:26
int eventNumber() const
Returns the event number.
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
int iEvent
Definition: GenABIO.cc:224
TupleMultiplicity< TrackerTraits > const *__restrict__ TrackingRecHitSoAConstView< TrackerTraits > TrackerTraits::tindex_type *__restrict__ double *__restrict__ phits
int ic() const
get ECAL/crystal number inside SM
Definition: EBDetId.cc:41
int S6ADC() const
returns S6 ADC value
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:60
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:29
bool tableIsMoving() const
Tell if the table is Moving.
const_iterator end() const
Namespace of DDCMS conversion namespace.
int zside() const
Definition: EEDetId.h:71
const_iterator begin() const
The iterator returned can not safely be used across threads.
float offset() const
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
int adc() const
get the ADC sample (12 bits)
static const int SMCRYSTALMODE
Definition: EBDetId.h:159
int iy() const
Definition: EEDetId.h:83

◆ beginRun()

void EcalSimple2007H4TBAnalyzer::beginRun ( edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
override

Definition at line 92 of file EcalSimple2007H4TBAnalyzer.cc.

References MillePedeFileConverter_cfg::e, geometryToken_, edm::EventSetup::getData(), h_ampltdc, h_bprofx, h_bprofy, h_e1e25, h_e1e25_mapx, h_e1e25_mapy, h_e1e9, h_e1e9_mapx, h_e1e9_mapy, h_e1x1, h_e1x1_center, h_e3x3, h_e3x3_center, h_e5x5, h_e5x5_center, h_e9e25, h_e9e25_mapx, h_e9e25_mapy, h_mapx, h_mapy, h_qualx, h_qualy, h_S6, h_Shape_, h_slopex, h_slopey, h_tableIsMoving, and theTBGeometry_.

92  {
93  //========================================================================
94 
95  theTBGeometry_ = &iSetup.getData(geometryToken_);
96 
97  // Amplitude vs TDC offset
98  h_ampltdc = new TH2F("h_ampltdc", "Max Amplitude vs TDC offset", 100, 0., 1., 1000, 0., 4000.);
99 
100  // Reconstructed energies
101  h_tableIsMoving = new TH1F("h_tableIsMoving", "TableIsMoving", 100000, 0., 100000.);
102 
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.);
106 
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.);
110 
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);
114 
115  h_S6 = new TH1F("h_S6", "Amplitude S6", 1000, 0., 4000.);
116 
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.);
119 
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.);
122 
123  h_slopex = new TH1F("h_slopex", "Beam Slope X", 500, -5e-4, 5e-4);
124  h_slopey = new TH1F("h_slopey", "Beam Slope Y", 500, -5e-4, 5e-4);
125 
126  char hname[50];
127  char htitle[50];
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.);
135  }
136 
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);
139 
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);
142 
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);
145 
146  h_Shape_ = new TH2F("h_Shape_", "Xtal in Beam Shape", 250, 0, 10, 350, 0, 3500);
147 }
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_

◆ endJob()

void EcalSimple2007H4TBAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 154 of file EcalSimple2007H4TBAnalyzer.cc.

References f, h_ampltdc, h_bprofx, h_bprofy, h_e1e25, h_e1e25_mapx, h_e1e25_mapy, h_e1e9, h_e1e9_mapx, h_e1e9_mapy, h_e1x1, h_e1x1_center, h_e3x3, h_e3x3_center, h_e5x5, h_e5x5_center, h_e9e25, h_e9e25_mapx, h_e9e25_mapy, h_mapx, h_mapy, h_qualx, h_qualy, h_S6, h_Shape_, h_slopex, h_slopey, h_tableIsMoving, and rootfile_.

154  {
155  //========================================================================
156 
157  TFile f(rootfile_.c_str(), "RECREATE");
158 
159  // Amplitude vs TDC offset
160  h_ampltdc->Write();
161 
162  // Reconstructed energies
163  h_e1x1->Write();
164  h_e3x3->Write();
165  h_e5x5->Write();
166 
167  h_e1x1_center->Write();
168  h_e3x3_center->Write();
169  h_e5x5_center->Write();
170 
171  h_e1e9->Write();
172  h_e1e25->Write();
173  h_e9e25->Write();
174 
175  h_S6->Write();
176  h_bprofx->Write();
177  h_bprofy->Write();
178 
179  h_qualx->Write();
180  h_qualy->Write();
181 
182  h_slopex->Write();
183  h_slopey->Write();
184 
185  h_Shape_->Write();
186 
187  for (unsigned int icry = 0; icry < 25; icry++) {
188  h_mapx[icry]->Write();
189  h_mapy[icry]->Write();
190  }
191 
192  h_e1e9_mapx->Write();
193  h_e1e9_mapy->Write();
194 
195  h_e1e25_mapx->Write();
196  h_e1e25_mapy->Write();
197 
198  h_e9e25_mapx->Write();
199  h_e9e25_mapy->Write();
200 
201  h_tableIsMoving->Write();
202 
203  f.Close();
204 }
double f[11][100]

◆ endRun()

void EcalSimple2007H4TBAnalyzer::endRun ( edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
override

Definition at line 150 of file EcalSimple2007H4TBAnalyzer.cc.

150 {}

Member Data Documentation

◆ digiCollection_

const std::string EcalSimple2007H4TBAnalyzer::digiCollection_
private

Definition at line 55 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

◆ digiProducer_

const std::string EcalSimple2007H4TBAnalyzer::digiProducer_
private

Definition at line 56 of file EcalSimple2007H4TBAnalyzer.h.

◆ eeDigiToken_

const edm::EDGetTokenT<EEDigiCollection> EcalSimple2007H4TBAnalyzer::eeDigiToken_
private

Definition at line 66 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

◆ eeUncalibratedRecHitToken_

const edm::EDGetTokenT<EEUncalibratedRecHitCollection> EcalSimple2007H4TBAnalyzer::eeUncalibratedRecHitToken_
private

Definition at line 67 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

◆ eventHeaderCollection_

const std::string EcalSimple2007H4TBAnalyzer::eventHeaderCollection_
private

Definition at line 63 of file EcalSimple2007H4TBAnalyzer.h.

◆ eventHeaderProducer_

const std::string EcalSimple2007H4TBAnalyzer::eventHeaderProducer_
private

Definition at line 64 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

◆ geometryToken_

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> EcalSimple2007H4TBAnalyzer::geometryToken_
private

Definition at line 71 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by beginRun().

◆ h_ampltdc

TH2F* EcalSimple2007H4TBAnalyzer::h_ampltdc
private

Definition at line 74 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_bprofx

TH1F* EcalSimple2007H4TBAnalyzer::h_bprofx
private

Definition at line 93 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_bprofy

TH1F* EcalSimple2007H4TBAnalyzer::h_bprofy
private

Definition at line 94 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e1e25

TH1F* EcalSimple2007H4TBAnalyzer::h_e1e25
private

Definition at line 89 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e1e25_mapx

TH2F* EcalSimple2007H4TBAnalyzer::h_e1e25_mapx
private

Definition at line 108 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e1e25_mapy

TH2F* EcalSimple2007H4TBAnalyzer::h_e1e25_mapy
private

Definition at line 109 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e1e9

TH1F* EcalSimple2007H4TBAnalyzer::h_e1e9
private

Definition at line 88 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e1e9_mapx

TH2F* EcalSimple2007H4TBAnalyzer::h_e1e9_mapx
private

Definition at line 105 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e1e9_mapy

TH2F* EcalSimple2007H4TBAnalyzer::h_e1e9_mapy
private

Definition at line 106 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e1x1

TH1F* EcalSimple2007H4TBAnalyzer::h_e1x1
private

Definition at line 80 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e1x1_center

TH1F* EcalSimple2007H4TBAnalyzer::h_e1x1_center
private

Definition at line 84 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e3x3

TH1F* EcalSimple2007H4TBAnalyzer::h_e3x3
private

Definition at line 81 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e3x3_center

TH1F* EcalSimple2007H4TBAnalyzer::h_e3x3_center
private

Definition at line 85 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e5x5

TH1F* EcalSimple2007H4TBAnalyzer::h_e5x5
private

Definition at line 82 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e5x5_center

TH1F* EcalSimple2007H4TBAnalyzer::h_e5x5_center
private

Definition at line 86 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e9e25

TH1F* EcalSimple2007H4TBAnalyzer::h_e9e25
private

Definition at line 90 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e9e25_mapx

TH2F* EcalSimple2007H4TBAnalyzer::h_e9e25_mapx
private

Definition at line 111 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_e9e25_mapy

TH2F* EcalSimple2007H4TBAnalyzer::h_e9e25_mapy
private

Definition at line 112 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_mapx

TH2F* EcalSimple2007H4TBAnalyzer::h_mapx[25]
private

Definition at line 102 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_mapy

TH2F* EcalSimple2007H4TBAnalyzer::h_mapy[25]
private

Definition at line 103 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_qualx

TH1F* EcalSimple2007H4TBAnalyzer::h_qualx
private

Definition at line 96 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_qualy

TH1F* EcalSimple2007H4TBAnalyzer::h_qualy
private

Definition at line 97 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_S6

TH1F* EcalSimple2007H4TBAnalyzer::h_S6
private

Definition at line 92 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_Shape_

TH2F* EcalSimple2007H4TBAnalyzer::h_Shape_
private

Definition at line 76 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_slopex

TH1F* EcalSimple2007H4TBAnalyzer::h_slopex
private

Definition at line 99 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_slopey

TH1F* EcalSimple2007H4TBAnalyzer::h_slopey
private

Definition at line 100 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ h_tableIsMoving

TH1F* EcalSimple2007H4TBAnalyzer::h_tableIsMoving
private

Definition at line 79 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), beginRun(), and endJob().

◆ hitCollection_

const std::string EcalSimple2007H4TBAnalyzer::hitCollection_
private

Definition at line 57 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), and EcalSimple2007H4TBAnalyzer().

◆ hitProducer_

const std::string EcalSimple2007H4TBAnalyzer::hitProducer_
private

Definition at line 58 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by EcalSimple2007H4TBAnalyzer().

◆ hodoRecInfoCollection_

const std::string EcalSimple2007H4TBAnalyzer::hodoRecInfoCollection_
private

Definition at line 59 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

◆ hodoRecInfoProducer_

const std::string EcalSimple2007H4TBAnalyzer::hodoRecInfoProducer_
private

Definition at line 60 of file EcalSimple2007H4TBAnalyzer.h.

◆ rootfile_

const std::string EcalSimple2007H4TBAnalyzer::rootfile_
private

Definition at line 54 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by endJob().

◆ tbEventHeaderToken_

const edm::EDGetTokenT<EcalTBEventHeader> EcalSimple2007H4TBAnalyzer::tbEventHeaderToken_
private

Definition at line 70 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

◆ tbHodoscopeRecInfoToken_

const edm::EDGetTokenT<EcalTBHodoscopeRecInfo> EcalSimple2007H4TBAnalyzer::tbHodoscopeRecInfoToken_
private

Definition at line 68 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

◆ tbTDCRecInfoToken_

const edm::EDGetTokenT<EcalTBTDCRecInfo> EcalSimple2007H4TBAnalyzer::tbTDCRecInfoToken_
private

Definition at line 69 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

◆ tdcRecInfoCollection_

const std::string EcalSimple2007H4TBAnalyzer::tdcRecInfoCollection_
private

Definition at line 61 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

◆ tdcRecInfoProducer_

const std::string EcalSimple2007H4TBAnalyzer::tdcRecInfoProducer_
private

Definition at line 62 of file EcalSimple2007H4TBAnalyzer.h.

◆ theTBGeometry_

const CaloGeometry* EcalSimple2007H4TBAnalyzer::theTBGeometry_
private

Definition at line 118 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), and beginRun().

◆ xtalInBeam_

EEDetId EcalSimple2007H4TBAnalyzer::xtalInBeam_
private

Definition at line 114 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

◆ xtalInBeamTmp

EBDetId EcalSimple2007H4TBAnalyzer::xtalInBeamTmp
private

Definition at line 115 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

◆ Xtals5x5

EEDetId EcalSimple2007H4TBAnalyzer::Xtals5x5[25]
private

Definition at line 116 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().