CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void analyze (const edm::Event &evt, const edm::EventSetup &evtSetup)
 
virtual void beginJob ()
 
 testEcalTPGScale (edm::ParameterSet const &pSet)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::ESHandle
< EcalTrigTowerConstituentsMap
eTTmap_
 
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 &)
 
- 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 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

Definition at line 23 of file testEcalTPGScale.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file testEcalTPGScale.cc.

References gather_cfg::cout.

15 {
16  std::cout<<"I'm going to check the internal consistancy of EcalTPGScale transformation..."<<std::endl ;
17 }
tuple cout
Definition: gather_cfg.py:145

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 19 of file testEcalTPGScale.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file testEcalTPGScale.cc.

76 {
77  using namespace edm;
78  using namespace std;
79 
80 }

Member Data Documentation

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

Definition at line 33 of file testEcalTPGScale.h.

Referenced by analyze().

const CaloSubdetectorGeometry* testEcalTPGScale::theBarrelGeometry_
private

Definition at line 32 of file testEcalTPGScale.h.

Referenced by analyze().

const CaloSubdetectorGeometry* testEcalTPGScale::theEndcapGeometry_
private

Definition at line 31 of file testEcalTPGScale.h.

Referenced by analyze().