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
 
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
 
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::ESGetToken< CaloSubdetectorGeometry, EcalBarrelGeometryRecordbarrelGeomToken_
 
edm::ESGetToken< CaloSubdetectorGeometry, EcalEndcapGeometryRecordendcapGeomToken_
 
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecordeTTmapToken_
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeomToken_
 
const CaloSubdetectorGeometrytheBarrelGeometry_
 
const CaloSubdetectorGeometrytheEndcapGeometry_
 
EcalTPGScale::Tokens tokens_
 

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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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 31 of file testEcalTPGScale.h.

Constructor & Destructor Documentation

◆ testEcalTPGScale()

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

Definition at line 12 of file testEcalTPGScale.cc.

13  : geomToken_(esConsumes<CaloGeometry, CaloGeometryRecord>()),
15  esConsumes<CaloSubdetectorGeometry, EcalEndcapGeometryRecord>(edm::ESInputTag{"", "EcalEndcap"})),
17  esConsumes<CaloSubdetectorGeometry, EcalBarrelGeometryRecord>(edm::ESInputTag{"", "EcalBarrel"})),
18  eTTmapToken_(esConsumes<EcalTrigTowerConstituentsMap, IdealGeometryRecord>()),
20  std::cout << "I'm going to check the internal consistancy of EcalTPGScale transformation..." << std::endl;
21 }

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 23 of file testEcalTPGScale.cc.

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

References barrelGeomToken_, gather_cfg::cout, DetId::Ecal, EcalBarrel, EcalEndcap, endcapGeomToken_, relativeConstraints::error, eTTmapToken_, geomToken_, edm::EventSetup::getHandle(), EcalTPGScale::getLinearizedTPG(), EcalTPGScale::getTPGInADC(), EcalTPGScale::getTPGInGeV(), CaloSubdetectorGeometry::getValidDetIds(), theBarrelGeometry_, theEndcapGeometry_, tokens_, and EBDetId::tower().

◆ beginJob()

void testEcalTPGScale::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file testEcalTPGScale.cc.

75  {
76  using namespace edm;
77  using namespace std;
78 }

Member Data Documentation

◆ barrelGeomToken_

edm::ESGetToken<CaloSubdetectorGeometry, EcalBarrelGeometryRecord> testEcalTPGScale::barrelGeomToken_
private

Definition at line 42 of file testEcalTPGScale.h.

Referenced by analyze().

◆ endcapGeomToken_

edm::ESGetToken<CaloSubdetectorGeometry, EcalEndcapGeometryRecord> testEcalTPGScale::endcapGeomToken_
private

Definition at line 41 of file testEcalTPGScale.h.

Referenced by analyze().

◆ eTTmapToken_

edm::ESGetToken<EcalTrigTowerConstituentsMap, IdealGeometryRecord> testEcalTPGScale::eTTmapToken_
private

Definition at line 43 of file testEcalTPGScale.h.

Referenced by analyze().

◆ geomToken_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> testEcalTPGScale::geomToken_
private

Definition at line 40 of file testEcalTPGScale.h.

Referenced by analyze().

◆ theBarrelGeometry_

const CaloSubdetectorGeometry* testEcalTPGScale::theBarrelGeometry_
private

Definition at line 39 of file testEcalTPGScale.h.

Referenced by analyze().

◆ theEndcapGeometry_

const CaloSubdetectorGeometry* testEcalTPGScale::theEndcapGeometry_
private

Definition at line 38 of file testEcalTPGScale.h.

Referenced by analyze().

◆ tokens_

EcalTPGScale::Tokens testEcalTPGScale::tokens_
private

Definition at line 44 of file testEcalTPGScale.h.

Referenced by analyze().

edm::ESInputTag
Definition: ESInputTag.h:87
EcalTPGScale
Definition: EcalTPGScale.h:16
testEcalTPGScale::theEndcapGeometry_
const CaloSubdetectorGeometry * theEndcapGeometry_
Definition: testEcalTPGScale.h:38
EBDetId
Definition: EBDetId.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:47
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
relativeConstraints.error
error
Definition: relativeConstraints.py:53
EcalBarrel
Definition: EcalSubdetector.h:10
testEcalTPGScale::endcapGeomToken_
edm::ESGetToken< CaloSubdetectorGeometry, EcalEndcapGeometryRecord > endcapGeomToken_
Definition: testEcalTPGScale.h:41
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
EEDetId
Definition: EEDetId.h:14
EcalEndcap
Definition: EcalSubdetector.h:10
testEcalTPGScale::geomToken_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
Definition: testEcalTPGScale.h:40
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
DetId::Ecal
Definition: DetId.h:27
std
Definition: JetResolutionObject.h:76
testEcalTPGScale::barrelGeomToken_
edm::ESGetToken< CaloSubdetectorGeometry, EcalBarrelGeometryRecord > barrelGeomToken_
Definition: testEcalTPGScale.h:42
testEcalTPGScale::tokens_
EcalTPGScale::Tokens tokens_
Definition: testEcalTPGScale.h:44
testEcalTPGScale::theBarrelGeometry_
const CaloSubdetectorGeometry * theBarrelGeometry_
Definition: testEcalTPGScale.h:39
testEcalTPGScale::eTTmapToken_
edm::ESGetToken< EcalTrigTowerConstituentsMap, IdealGeometryRecord > eTTmapToken_
Definition: testEcalTPGScale.h:43