CMS 3D CMS Logo

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

#include <EcalSimple2007H4TBAnalyzer.h>

Inheritance diagram for EcalSimple2007H4TBAnalyzer:
edm::EDAnalyzer 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
 
 ~EcalSimple2007H4TBAnalyzer () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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
 
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::vector< ModuleDescription const * > &modules, 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

std::string digiCollection_
 
std::string digiProducer_
 
std::string eventHeaderCollection_
 
std::string eventHeaderProducer_
 
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
 
std::string hitCollection_
 
std::string hitProducer_
 
std::string hodoRecInfoCollection_
 
std::string hodoRecInfoProducer_
 
std::string rootfile_
 
std::string tdcRecInfoCollection_
 
std::string tdcRecInfoProducer_
 
const CaloGeometrytheTBGeometry_
 
EEDetId xtalInBeam_
 
EBDetId xtalInBeamTmp
 
EEDetId Xtals5x5 [25]
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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<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)
 

Detailed Description

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

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

Definition at line 44 of file EcalSimple2007H4TBAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 50 of file EcalSimple2007H4TBAnalyzer.cc.

References gather_cfg::cout, digiCollection_, digiProducer_, eventHeaderCollection_, eventHeaderProducer_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hitCollection_, hitProducer_, hodoRecInfoCollection_, hodoRecInfoProducer_, rootfile_, AlCaHLTBitMon_QueryRunRegistry::string, tdcRecInfoCollection_, and tdcRecInfoProducer_.

50  : xtalInBeam_(0)
51 //========================================================================
52 {
53  //now do what ever initialization is needed
54  rootfile_ = iConfig.getUntrackedParameter<std::string>("rootfile","ecalSimpleTBanalysis.root");
55  digiCollection_ = iConfig.getParameter<std::string>("digiCollection");
56  digiProducer_ = iConfig.getParameter<std::string>("digiProducer");
57  hitCollection_ = iConfig.getParameter<std::string>("hitCollection");
58  hitProducer_ = iConfig.getParameter<std::string>("hitProducer");
59  hodoRecInfoCollection_ = iConfig.getParameter<std::string>("hodoRecInfoCollection");
60  hodoRecInfoProducer_ = iConfig.getParameter<std::string>("hodoRecInfoProducer");
61  tdcRecInfoCollection_ = iConfig.getParameter<std::string>("tdcRecInfoCollection");
62  tdcRecInfoProducer_ = iConfig.getParameter<std::string>("tdcRecInfoProducer");
63  eventHeaderCollection_ = iConfig.getParameter<std::string>("eventHeaderCollection");
64  eventHeaderProducer_ = iConfig.getParameter<std::string>("eventHeaderProducer");
65 
66 
67  std::cout << "EcalSimple2007H4TBAnalyzer: fetching hitCollection: " << hitCollection_.c_str()
68  << " produced by " << hitProducer_.c_str() << std::endl;
69 
70 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
EcalSimple2007H4TBAnalyzer::~EcalSimple2007H4TBAnalyzer ( )
override

Definition at line 74 of file EcalSimple2007H4TBAnalyzer.cc.

76 {
77  // do anything here that needs to be done at desctruction time
78  // (e.g. close files, deallocate resources etc.)
79  // Amplitude vs TDC offset
80 // if (h_ampltdc)
81 // delete h_ampltdc;
82 
83 // // Reconstructed energies
84 // delete h_e1x1;
85 // delete h_e3x3;
86 // delete h_e5x5;
87 
88 // delete h_bprofx;
89 // delete h_bprofy;
90 
91 // delete h_qualx;
92 // delete h_qualy;
93 
94 // delete h_slopex;
95 // delete h_slopey;
96 
97 // delete h_mapx;
98 // delete h_mapy;
99 
100 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 232 of file EcalSimple2007H4TBAnalyzer.cc.

References EcalMGPASample::adc(), CustomPhysics_cfi::amplitude, edm::SortedCollection< T, SORT >::begin(), edm::DataFrameContainer::begin(), gather_cfg::cout, EcalTBEventHeader::crystalInBeam(), digiCollection_, digiProducer_, photonPostprocessing_cfi::eMax, edm::SortedCollection< T, SORT >::empty(), edm::SortedCollection< T, SORT >::end(), edm::DataFrameContainer::end(), eventHeaderProducer_, EcalTBEventHeader::eventNumber(), edm::SortedCollection< T, SORT >::find(), edm::Event::getByLabel(), 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_, hitProducer_, hfClusterShapes_cfi::hits, hodoRecInfoCollection_, hodoRecInfoProducer_, mps_fire::i, EBDetId::ic(), createfilelist::int, edm::HandleBase::isValid(), MTVHistoProducerAlgoForTrackerBlock_cfi::maxHit, DetId::null(), EcalTBTDCRecInfo::offset(), EcalTBHodoscopeRecInfo::posX(), EcalTBHodoscopeRecInfo::posY(), edm::Handle< T >::product(), EcalTBHodoscopeRecInfo::qualX(), EcalTBHodoscopeRecInfo::qualY(), EcalTBEventHeader::S6ADC(), simplePhotonAnalyzer_cfi::sample, EcalDataFrame::sample(), EcalDataFrame::size(), EcalTBHodoscopeRecInfo::slopeX(), EcalTBHodoscopeRecInfo::slopeY(), EBDetId::SMCRYSTALMODE, EcalTBEventHeader::tableIsMoving(), tdcRecInfoCollection_, tdcRecInfoProducer_, theTBGeometry_, x, xtalInBeam_, xtalInBeamTmp, Xtals5x5, y, and EBDetId::zside().

232  {
233 //========================================================================
234 
235  using namespace edm;
236  using namespace cms;
237 
238 
239 
241  const EEDigiCollection* digis=nullptr;
242  //std::cout << "EcalSimple2007H4TBAnalyzer::analyze getting product with label: " << digiProducer_.c_str()<< " prodname: " << digiCollection_.c_str() << endl;
243  iEvent.getByLabel( digiProducer_, digiCollection_,pdigis);
244  if ( pdigis.isValid() ) {
245  digis = pdigis.product(); // get a ptr to the product
246  //iEvent.getByLabel( hitProducer_, phits);
247  } else {
248  edm::LogError("EcalSimple2007H4TBAnalyzerError") << "Error! can't get the product " << digiCollection_;
249  }
250 
251  // fetch the digis and compute signal amplitude
253  const EEUncalibratedRecHitCollection* hits=nullptr;
254  //std::cout << "EcalSimple2007H4TBAnalyzer::analyze getting product with label: " << digiProducer_.c_str()<< " prodname: " << digiCollection_.c_str() << endl;
255  iEvent.getByLabel( hitProducer_, hitCollection_,phits);
256  if (phits.isValid()) {
257  hits = phits.product(); // get a ptr to the product
258  //iEvent.getByLabel( hitProducer_, phits);
259  } else {
260  edm::LogError("EcalSimple2007H4TBAnalyzerError") << "Error! can't get the product " << hitCollection_;
261  }
262 
264  const EcalTBHodoscopeRecInfo* recHodo=nullptr;
265  //std::cout << "EcalSimple2007H4TBAnalyzer::analyze getting product with label: " << digiProducer_.c_str()<< " prodname: " << digiCollection_.c_str() << endl;
267  if ( pHodo.isValid() ) {
268  recHodo = pHodo.product(); // get a ptr to the product
269  } else {
270  edm::LogError("EcalSimple2007H4TBAnalyzerError") << "Error! can't get the product " << hodoRecInfoCollection_;
271  }
272 
274  const EcalTBTDCRecInfo* recTDC=nullptr;
275  //std::cout << "EcalSimple2007H4TBAnalyzer::analyze getting product with label: " << digiProducer_.c_str()<< " prodname: " << digiCollection_.c_str() << endl;
277  if ( pTDC.isValid() ) {
278  recTDC = pTDC.product(); // get a ptr to the product
279  } else {
280  edm::LogError("EcalSimple2007H4TBAnalyzerError") << "Error! can't get the product " << tdcRecInfoCollection_;
281  }
282 
283  Handle<EcalTBEventHeader> pEventHeader;
284  const EcalTBEventHeader* evtHeader=nullptr;
285  //std::cout << "EcalSimple2007H4TBAnalyzer::analyze getting product with label: " << digiProducer_.c_str()<< " prodname: " << digiCollection_.c_str() << endl;
286  iEvent.getByLabel( eventHeaderProducer_ , pEventHeader );
287  if ( pEventHeader.isValid() ) {
288  evtHeader = pEventHeader.product(); // get a ptr to the product
289  } else {
290  edm::LogError("EcalSimple2007H4TBAnalyzerError") << "Error! can't get the product " << eventHeaderProducer_;
291  }
292 
293 
294  if (!hits)
295  {
296  // std::cout << "1" << std::endl;
297  return;
298  }
299 
300  if (!recTDC)
301  {
302  // std::cout << "2" << std::endl;
303  return;
304  }
305 
306  if (!recHodo)
307  {
308  // std::cout << "3" << std::endl;
309  return;
310  }
311 
312  if (!evtHeader)
313  {
314  // std::cout << "4" << std::endl;
315  return;
316  }
317 
318  if (hits->empty())
319  {
320  // std::cout << "5" << std::endl;
321  return;
322  }
323 
324  //Accessing various event information
325  if (evtHeader->tableIsMoving())
326  h_tableIsMoving->Fill(evtHeader->eventNumber());
327 
328 // std::cout << "event " << evtHeader->eventNumber()
329 // << "\trun number " << evtHeader->runNumber()
330 // << "\tburst number " << evtHeader->burstNumber()
331 // << "\tbeginLV1A " << evtHeader->begBurstLV1A()
332 // << "\tendLV1A " << evtHeader->endBurstLV1A()
333 // << "\ttime " << evtHeader->date()
334 // << "\thas errors " << int(evtHeader->syncError())
335 // << std::endl;
336 
337 // std::cout << "scaler";
338 // for (int iscaler=0;iscaler < 36;iscaler++)
339 // std::cout << "\t#" << iscaler << " " << evtHeader->scaler(iscaler);
340 // std::cout<<std::endl;
341 
342  //S6 beam scintillator
343  h_S6->Fill(evtHeader->S6ADC());
344 
345  if (xtalInBeamTmp.null())
346  {
348  xtalInBeam_ = EEDetId( 35 - ((xtalInBeamTmp.ic()-1)%20) ,int(int(xtalInBeamTmp.ic())/int(20))+51, -1);
349  std::cout<< "Xtal In Beam is " << xtalInBeam_.ic() << xtalInBeam_ << std::endl;
350  for (unsigned int icry=0;icry<25;icry++)
351  {
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;
356  EEDetId tempId(ix, iy, xtalInBeam_.zside());
357  //Selecting matrix of xtals used in 2007H4TB
358  if (tempId.ix()<16 || tempId.ix()>35 || tempId.iy()<51 || tempId.iy()>75)
359  Xtals5x5[icry]=EEDetId(0);
360  else
361  {
362  Xtals5x5[icry]=tempId;
363  auto cell=theTBGeometry_->getGeometry(Xtals5x5[icry]);
364  if (!cell)
365  continue;
366  std::cout << "** Xtal in the matrix **** row " << row << ", column " << column << ", xtal " << Xtals5x5[icry] << " Position " << cell->getPosition(0.) << std::endl;
367  }
368  }
369  }
370  else
371  if (xtalInBeamTmp != EBDetId(1,evtHeader->crystalInBeam(),EBDetId::SMCRYSTALMODE)) //run analysis only on first xtal in beam
372  return;
373 
374  //Avoid moving table events
375  if (evtHeader->tableIsMoving())
376  {
377  std::cout << "Table is moving" << std::endl;
378  return;
379  }
380 
381 
382 
383  // Searching for max amplitude xtal alternative to use xtalInBeam_
384  EEDetId maxHitId(0);
385  float maxHit= -999999.;
386  for(EEUncalibratedRecHitCollection::const_iterator ithit = hits->begin(); ithit != hits->end(); ++ithit)
387  {
388  if (ithit->amplitude()>=maxHit)
389  {
390  maxHit=ithit->amplitude();
391  maxHitId=ithit->id();
392  }
393 
394  }
395  if (maxHitId==EEDetId(0))
396  {
397  std::cout << "No maxHit found" << std::endl;
398  return;
399  }
400 
401 
402  //Filling the digis shape for the xtalInBeam
403  double samples_save[10]; for(int i=0; i < 10; ++i) samples_save[i]=0.0;
404 
405  double eMax = 0.;
406  for ( EEDigiCollection::const_iterator digiItr= digis->begin();digiItr != digis->end();
407  ++digiItr )
408  {
409  if ( EEDetId((*digiItr).id()) != xtalInBeam_ )
410  continue;
411 
412  EEDataFrame myDigi = (*digiItr);
413  for (int sample = 0; sample < myDigi.size(); ++sample)
414  {
415  double analogSample = myDigi.sample(sample).adc();
416  samples_save[sample] = analogSample;
417  // std::cout << analogSample << " ";
418  if ( eMax < analogSample )
419  {
420  eMax = analogSample;
421  }
422  }
423  // std::cout << std::endl;
424  }
425 
426  for(int i =0; i < 10; ++i)
427  h_Shape_->Fill(double(i)+recTDC->offset(),samples_save[i]);
428 
429 
430 
431  // Taking amplitudes in 5x5
432  double amplitude[25];
433  double amplitude3x3=0;
434  double amplitude5x5=0;
435  for (unsigned int icry=0;icry<25;icry++)
436  {
437  if (!Xtals5x5[icry].null())
438  {
439  amplitude[icry]=(hits->find(Xtals5x5[icry]))->amplitude();
440  amplitude5x5 += amplitude[icry];
441  // Is in 3x3?
442  if ( icry == 6 || icry == 7 || icry == 8 ||
443  icry == 11 || icry == 12 || icry ==13 ||
444  icry == 16 || icry == 17 || icry ==18 )
445  {
446  amplitude3x3+=amplitude[icry];
447  }
448  }
449  }
450 
451  //Filling amplitudes
452  h_e1x1->Fill(amplitude[12]);
453  h_e3x3->Fill(amplitude3x3);
454  h_e5x5->Fill(amplitude5x5);
455 
456  h_e1e9->Fill(amplitude[12]/amplitude3x3);
457  h_e1e25->Fill(amplitude[12]/amplitude5x5);
458  h_e9e25->Fill(amplitude3x3/amplitude5x5);
459 
460  //Checking stability of amplitude vs TDC
461  if (recTDC)
462  h_ampltdc->Fill(recTDC->offset(),amplitude[12]);
463 
464  //Various amplitudes as a function of hodoscope coordinates
465  if (recHodo)
466  {
467  float x=recHodo->posX();
468  float y=recHodo->posY();
469  float xslope=recHodo->slopeX();
470  float yslope=recHodo->slopeY();
471  float xqual=recHodo->qualX();
472  float yqual=recHodo->qualY();
473 
474  //Filling beam profiles
475  h_bprofx->Fill(x);
476  h_bprofy->Fill(y);
477  h_qualx->Fill(xqual);
478  h_qualy->Fill(yqual);
479  h_slopex->Fill(xslope);
480  h_slopey->Fill(yslope);
481 
482  //Fill central events
483 
484 
485  if ( fabs(x + 2.5) < 2.5 && fabs(y + 0.5) < 2.5)
486  {
487  h_e1x1_center->Fill(amplitude[12]);
488  h_e3x3_center->Fill(amplitude3x3);
489  h_e5x5_center->Fill(amplitude5x5);
490  }
491 
492  for (unsigned int icry=0;icry<25;icry++)
493  {
494  h_mapx[icry]->Fill(x,amplitude[icry]);
495  h_mapy[icry]->Fill(y,amplitude[icry]);
496  }
497 
498  h_e1e9_mapx->Fill(x,amplitude[12]/amplitude3x3);
499  h_e1e9_mapy->Fill(y,amplitude[12]/amplitude3x3);
500 
501  h_e1e25_mapx->Fill(x,amplitude[12]/amplitude5x5);
502  h_e1e25_mapy->Fill(y,amplitude[12]/amplitude5x5);
503 
504  h_e9e25_mapx->Fill(x,amplitude3x3/amplitude5x5);
505  h_e9e25_mapy->Fill(y,amplitude3x3/amplitude5x5);
506  }
507 
508 }
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
bool tableIsMoving() const
Tell if the table is Moving.
constexpr bool null() const
is this a null id ?
Definition: DetId.h:52
std::vector< T >::const_iterator const_iterator
EcalMGPASample sample(int i) const
Definition: EcalDataFrame.h:29
const_iterator begin() const
int crystalInBeam() const
Returns the crystal which is being hit by the beam (in the internal SM numbering scheme) ...
int size() const
Definition: EcalDataFrame.h:26
int iEvent
Definition: GenABIO.cc:224
int S6ADC() const
returns S6 ADC value
bool isValid() const
Definition: HandleBase.h:74
int ic() const
get ECAL/crystal number inside SM
Definition: EBDetId.cc:41
Namespace of DDCMS conversion namespace.
const_iterator end() const
T const * product() const
Definition: Handle.h:74
int eventNumber() const
Returns the event number.
const_iterator end() const
iterator find(key_type k)
HLT enums.
std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id.
Definition: CaloGeometry.cc:85
static const int SMCRYSTALMODE
Definition: EBDetId.h:159
float offset() const
const_iterator begin() const
int adc() const
get the ADC sample (12 bits)
int zside() const
get the z-side of the crystal (1/-1)
Definition: EBDetId.h:45
void EcalSimple2007H4TBAnalyzer::beginRun ( edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 104 of file EcalSimple2007H4TBAnalyzer.cc.

References MillePedeFileConverter_cfg::e, edm::EventSetup::get(), 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, edm::ESHandle< T >::product(), and theTBGeometry_.

104  {
105 //========================================================================
106 
108  iSetup.get<CaloGeometryRecord>().get(pG);
109 
110 
111  theTBGeometry_ = pG.product();
112 // const std::vector<DetId>& validIds=theTBGeometry_->getValidDetIds(DetId::Ecal,EcalEndcap);
113 // std::cout << "Found " << validIds.size() << " channels in the geometry" << std::endl;
114 // for (unsigned int i=0;i<validIds.size();++i)
115 // std::cout << EEDetId(validIds[i]) << std::endl;
116 
117 // Amplitude vs TDC offset
118  h_ampltdc = new TH2F("h_ampltdc","Max Amplitude vs TDC offset", 100,0.,1.,1000, 0., 4000.);
119 
120  // Reconstructed energies
121  h_tableIsMoving = new TH1F("h_tableIsMoving","TableIsMoving", 100000, 0., 100000.);
122 
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.);
126 
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.);
130 
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);
134 
135  h_S6 = new TH1F("h_S6","Amplitude S6", 1000, 0., 4000.);
136 
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.);
139 
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.);
142 
143  h_slopex = new TH1F("h_slopex","Beam Slope X",500, -5e-4 , 5e-4 );
144  h_slopey = new TH1F("h_slopey","Beam Slope Y",500, -5e-4 , 5e-4 );
145 
146  char hname[50];
147  char htitle[50];
148  for (unsigned int icry=0;icry<25;icry++)
149  {
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.);
156  }
157 
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);
160 
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);
163 
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);
166 
167  h_Shape_ = new TH2F("h_Shape_","Xtal in Beam Shape",250,0,10,350,0,3500);
168 
169 }
T const * product() const
Definition: ESHandle.h:86
void EcalSimple2007H4TBAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 173 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_.

173  {
174 //========================================================================
175 
176  TFile f(rootfile_.c_str(),"RECREATE");
177 
178  // Amplitude vs TDC offset
179  h_ampltdc->Write();
180 
181  // Reconstructed energies
182  h_e1x1->Write();
183  h_e3x3->Write();
184  h_e5x5->Write();
185 
186  h_e1x1_center->Write();
187  h_e3x3_center->Write();
188  h_e5x5_center->Write();
189 
190  h_e1e9->Write();
191  h_e1e25->Write();
192  h_e9e25->Write();
193 
194  h_S6->Write();
195  h_bprofx->Write();
196  h_bprofy->Write();
197 
198  h_qualx->Write();
199  h_qualy->Write();
200 
201  h_slopex->Write();
202  h_slopey->Write();
203 
204  h_Shape_->Write();
205 
206  for (unsigned int icry=0;icry<25;icry++)
207  {
208  h_mapx[icry]->Write();
209  h_mapy[icry]->Write();
210  }
211 
212  h_e1e9_mapx->Write();
213  h_e1e9_mapy->Write();
214 
215  h_e1e25_mapx->Write();
216  h_e1e25_mapy->Write();
217 
218  h_e9e25_mapx->Write();
219  h_e9e25_mapy->Write();
220 
221  h_tableIsMoving->Write();
222 
223  f.Close();
224 }
double f[11][100]

Member Data Documentation

std::string EcalSimple2007H4TBAnalyzer::digiCollection_
private

Definition at line 55 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), and EcalSimple2007H4TBAnalyzer().

std::string EcalSimple2007H4TBAnalyzer::digiProducer_
private

Definition at line 56 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), and EcalSimple2007H4TBAnalyzer().

std::string EcalSimple2007H4TBAnalyzer::eventHeaderCollection_
private

Definition at line 63 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by EcalSimple2007H4TBAnalyzer().

std::string EcalSimple2007H4TBAnalyzer::eventHeaderProducer_
private

Definition at line 64 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), and EcalSimple2007H4TBAnalyzer().

TH2F* EcalSimple2007H4TBAnalyzer::h_ampltdc
private

Definition at line 67 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_bprofx
private

Definition at line 86 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_bprofy
private

Definition at line 87 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_e1e25
private

Definition at line 82 of file EcalSimple2007H4TBAnalyzer.h.

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

TH2F* EcalSimple2007H4TBAnalyzer::h_e1e25_mapx
private

Definition at line 101 of file EcalSimple2007H4TBAnalyzer.h.

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

TH2F* EcalSimple2007H4TBAnalyzer::h_e1e25_mapy
private

Definition at line 102 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_e1e9
private

Definition at line 81 of file EcalSimple2007H4TBAnalyzer.h.

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

TH2F* EcalSimple2007H4TBAnalyzer::h_e1e9_mapx
private

Definition at line 98 of file EcalSimple2007H4TBAnalyzer.h.

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

TH2F* EcalSimple2007H4TBAnalyzer::h_e1e9_mapy
private

Definition at line 99 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_e1x1
private

Definition at line 73 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_e1x1_center
private

Definition at line 77 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_e3x3
private

Definition at line 74 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_e3x3_center
private

Definition at line 78 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_e5x5
private

Definition at line 75 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_e5x5_center
private

Definition at line 79 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_e9e25
private

Definition at line 83 of file EcalSimple2007H4TBAnalyzer.h.

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

TH2F* EcalSimple2007H4TBAnalyzer::h_e9e25_mapx
private

Definition at line 104 of file EcalSimple2007H4TBAnalyzer.h.

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

TH2F* EcalSimple2007H4TBAnalyzer::h_e9e25_mapy
private

Definition at line 105 of file EcalSimple2007H4TBAnalyzer.h.

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

TH2F* EcalSimple2007H4TBAnalyzer::h_mapx[25]
private

Definition at line 95 of file EcalSimple2007H4TBAnalyzer.h.

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

TH2F* EcalSimple2007H4TBAnalyzer::h_mapy[25]
private

Definition at line 96 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_qualx
private

Definition at line 89 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_qualy
private

Definition at line 90 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_S6
private

Definition at line 85 of file EcalSimple2007H4TBAnalyzer.h.

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

TH2F* EcalSimple2007H4TBAnalyzer::h_Shape_
private

Definition at line 69 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_slopex
private

Definition at line 92 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_slopey
private

Definition at line 93 of file EcalSimple2007H4TBAnalyzer.h.

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

TH1F* EcalSimple2007H4TBAnalyzer::h_tableIsMoving
private

Definition at line 72 of file EcalSimple2007H4TBAnalyzer.h.

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

std::string EcalSimple2007H4TBAnalyzer::hitCollection_
private

Definition at line 57 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), and EcalSimple2007H4TBAnalyzer().

std::string EcalSimple2007H4TBAnalyzer::hitProducer_
private

Definition at line 58 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), and EcalSimple2007H4TBAnalyzer().

std::string EcalSimple2007H4TBAnalyzer::hodoRecInfoCollection_
private

Definition at line 59 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), and EcalSimple2007H4TBAnalyzer().

std::string EcalSimple2007H4TBAnalyzer::hodoRecInfoProducer_
private

Definition at line 60 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), and EcalSimple2007H4TBAnalyzer().

std::string EcalSimple2007H4TBAnalyzer::rootfile_
private

Definition at line 54 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by EcalSimple2007H4TBAnalyzer(), and endJob().

std::string EcalSimple2007H4TBAnalyzer::tdcRecInfoCollection_
private

Definition at line 61 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), and EcalSimple2007H4TBAnalyzer().

std::string EcalSimple2007H4TBAnalyzer::tdcRecInfoProducer_
private

Definition at line 62 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), and EcalSimple2007H4TBAnalyzer().

const CaloGeometry* EcalSimple2007H4TBAnalyzer::theTBGeometry_
private

Definition at line 111 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze(), and beginRun().

EEDetId EcalSimple2007H4TBAnalyzer::xtalInBeam_
private

Definition at line 107 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

EBDetId EcalSimple2007H4TBAnalyzer::xtalInBeamTmp
private

Definition at line 108 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().

EEDetId EcalSimple2007H4TBAnalyzer::Xtals5x5[25]
private

Definition at line 109 of file EcalSimple2007H4TBAnalyzer.h.

Referenced by analyze().