CMS 3D CMS Logo

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

#include <testEcalTPGScale.h>

Inheritance diagram for testEcalTPGScale:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &evt, const edm::EventSetup &evtSetup) override
 
void beginJob () override
 
 testEcalTPGScale (edm::ParameterSet const &pSet)
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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

edm::ESHandle< EcalTrigTowerConstituentsMapeTTmap_
 
const CaloSubdetectorGeometrytheBarrelGeometry_
 
const CaloSubdetectorGeometrytheEndcapGeometry_
 

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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 23 of file testEcalTPGScale.h.

Constructor & Destructor Documentation

◆ testEcalTPGScale()

testEcalTPGScale::testEcalTPGScale ( edm::ParameterSet const &  pSet)
explicit

Definition at line 13 of file testEcalTPGScale.cc.

13  {
14  std::cout << "I'm going to check the internal consistancy of EcalTPGScale transformation..." << std::endl;
15 }

References gather_cfg::cout.

Member Function Documentation

◆ analyze()

void testEcalTPGScale::analyze ( const edm::Event evt,
const edm::EventSetup evtSetup 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 17 of file testEcalTPGScale.cc.

17  {
18  using namespace edm;
19  using namespace std;
20 
21  // geometry
22  ESHandle<CaloGeometry> theGeometry;
23  ESHandle<CaloSubdetectorGeometry> theEndcapGeometry_handle, theBarrelGeometry_handle;
24  evtSetup.get<CaloGeometryRecord>().get(theGeometry);
25  evtSetup.get<EcalEndcapGeometryRecord>().get("EcalEndcap", theEndcapGeometry_handle);
26  evtSetup.get<EcalBarrelGeometryRecord>().get("EcalBarrel", theBarrelGeometry_handle);
27  evtSetup.get<IdealGeometryRecord>().get(eTTmap_);
28  theEndcapGeometry_ = &(*theEndcapGeometry_handle);
29  theBarrelGeometry_ = &(*theBarrelGeometry_handle);
30 
31  EcalTPGScale ecalScale;
32  ecalScale.setEventSetup(evtSetup);
33 
34  bool error(false);
35  vector<DetId>::const_iterator it;
36 
37  // EB
38  const std::vector<DetId>& ebCells = theBarrelGeometry_->getValidDetIds(DetId::Ecal, EcalBarrel);
39  it = ebCells.begin();
40  const EBDetId idEB(*it);
41  const EcalTrigTowerDetId towidEB = idEB.tower();
42  for (unsigned int ADC = 0; ADC < 256; ADC++) {
43  double gev = ecalScale.getTPGInGeV(ADC, towidEB);
44  unsigned int tpgADC = ecalScale.getTPGInADC(gev, towidEB);
45  if (tpgADC != ADC) {
46  error = true;
47  cout << " ERROR : with ADC = " << ADC << " getTPGInGeV = " << gev << " getTPGInADC = " << tpgADC << endl;
48  }
49  ecalScale.getLinearizedTPG(ADC, towidEB);
50  }
51 
52  // EE
53  const std::vector<DetId>& eeCells = theEndcapGeometry_->getValidDetIds(DetId::Ecal, EcalEndcap);
54  it = eeCells.begin();
55  const EEDetId idEE(*it);
56  const EcalTrigTowerDetId towidEE = (*eTTmap_).towerOf(idEE);
57  for (unsigned int ADC = 0; ADC < 256; ADC++) {
58  double gev = ecalScale.getTPGInGeV(ADC, towidEE);
59  unsigned int tpgADC = ecalScale.getTPGInADC(gev, towidEE);
60  if (tpgADC != ADC) {
61  error = true;
62  cout << " ERROR : with ADC = " << ADC << " getTPGInGeV = " << gev << " getTPGInADC = " << tpgADC << endl;
63  }
64  ecalScale.getLinearizedTPG(ADC, towidEE);
65  }
66 
67  if (!error)
68  cout << " there is no error with EcalTPGScale internal consistancy " << endl;
69 }

References gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, relativeConstraints::error, eTTmap_, edm::EventSetup::get(), get, EcalTPGScale::getLinearizedTPG(), EcalTPGScale::getTPGInADC(), EcalTPGScale::getTPGInGeV(), CaloSubdetectorGeometry::getValidDetIds(), EcalTPGScale::setEventSetup(), theBarrelGeometry_, theEndcapGeometry_, and EBDetId::tower().

◆ beginJob()

void testEcalTPGScale::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 71 of file testEcalTPGScale.cc.

71  {
72  using namespace edm;
73  using namespace std;
74 }

Member Data Documentation

◆ eTTmap_

edm::ESHandle<EcalTrigTowerConstituentsMap> testEcalTPGScale::eTTmap_
private

Definition at line 32 of file testEcalTPGScale.h.

Referenced by analyze().

◆ theBarrelGeometry_

const CaloSubdetectorGeometry* testEcalTPGScale::theBarrelGeometry_
private

Definition at line 31 of file testEcalTPGScale.h.

Referenced by analyze().

◆ theEndcapGeometry_

const CaloSubdetectorGeometry* testEcalTPGScale::theEndcapGeometry_
private

Definition at line 30 of file testEcalTPGScale.h.

Referenced by analyze().

EcalTPGScale::getTPGInGeV
double getTPGInGeV(const EcalTriggerPrimitiveDigi &tpDigi)
Definition: EcalTPGScale.cc:18
testEcalTPGScale::eTTmap_
edm::ESHandle< EcalTrigTowerConstituentsMap > eTTmap_
Definition: testEcalTPGScale.h:32
EcalTPGScale
Definition: EcalTPGScale.h:8
testEcalTPGScale::theEndcapGeometry_
const CaloSubdetectorGeometry * theEndcapGeometry_
Definition: testEcalTPGScale.h:30
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EBDetId
Definition: EBDetId.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalEndcapGeometryRecord
Definition: EcalEndcapGeometryRecord.h:23
EcalTPGScale::setEventSetup
void setEventSetup(const edm::EventSetup &evtSetup)
Definition: EcalTPGScale.cc:16
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
relativeConstraints.error
error
Definition: relativeConstraints.py:53
EcalBarrelGeometryRecord
Definition: EcalBarrelGeometryRecord.h:23
EcalBarrel
Definition: EcalSubdetector.h:10
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
EcalTPGScale::getLinearizedTPG
unsigned int getLinearizedTPG(unsigned int ADC, const EcalTrigTowerDetId &towerId)
Definition: EcalTPGScale.cc:47
edm::ESHandle< CaloGeometry >
ADC
Definition: ZdcTBAnalysis.h:46
CaloSubdetectorGeometry::getValidDetIds
virtual const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const
Get a list of valid detector ids (for the given subdetector)
Definition: CaloSubdetectorGeometry.cc:32
EcalTPGScale::getTPGInADC
unsigned int getTPGInADC(double energy, const EcalTrigTowerDetId &towerId)
Definition: EcalTPGScale.cc:75
EEDetId
Definition: EEDetId.h:14
EcalEndcap
Definition: EcalSubdetector.h:10
DetId::Ecal
Definition: DetId.h:27
get
#define get
std
Definition: JetResolutionObject.h:76
testEcalTPGScale::theBarrelGeometry_
const CaloSubdetectorGeometry * theBarrelGeometry_
Definition: testEcalTPGScale.h:31
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27