CMS 3D CMS Logo

EcalTrigPrimFunctionalAlgo.cc
Go to the documentation of this file.
1 
15 #include <algorithm>
16 #include <functional>
17 #include <numeric>
18 #include <string>
19 
21 
26 
31 
37 
40 
41 #include <TMath.h>
42 #include <TTree.h>
43 
44 const unsigned int EcalTrigPrimFunctionalAlgo::nrSamples_ = 5; // to be written
45 const unsigned int EcalTrigPrimFunctionalAlgo::maxNrSamplesOut_ = 10;
46 const unsigned int EcalTrigPrimFunctionalAlgo::maxNrTowers_ = 2448;
47 const unsigned int EcalTrigPrimFunctionalAlgo::maxNrTPs_ = 2448; // FIXME??
48 
49 //----------------------------------------------------------------------
50 
52  const edm::EventSetup &setup, int binofmax, bool tcpFormat, bool barrelOnly, bool debug, bool famos)
53  : binOfMaximum_(binofmax),
54  tcpFormat_(tcpFormat),
55  barrelOnly_(barrelOnly),
56  debug_(debug),
57  famos_(famos)
58 
59 {
60  if (famos_)
61  maxNrSamples_ = 1; // get from input??
62  else
63  maxNrSamples_ = 10;
64  this->init(setup);
65 }
66 
67 //----------------------------------------------------------------------
69  if (!barrelOnly_) {
70  edm::ESHandle<CaloGeometry> theGeometry;
71  edm::ESHandle<CaloSubdetectorGeometry> theEndcapGeometry_handle;
72  setup.get<CaloGeometryRecord>().get(theGeometry);
73  setup.get<EcalEndcapGeometryRecord>().get("EcalEndcap", theEndcapGeometry_handle);
74  theEndcapGeometry = &(*theEndcapGeometry_handle);
76  }
77  // endcap mapping
79  setup.get<EcalMappingRcd>().get(ecalmapping);
80  theMapping_ = ecalmapping.product();
81 
82  // create main sub algos
85 
86  // initialise data structures
89 
90  hitTowers_.resize(maxNrTowers_);
91  towtp_.resize(maxNrSamplesOut_);
92  towtp2_.resize(maxNrSamplesOut_);
93 }
94 //----------------------------------------------------------------------
95 
97  delete estrip_;
98  delete etcp_;
99 }
100 //----------------------------------------------------------------------
102  EBDigiCollection const *col,
104  EcalTrigPrimDigiCollection &resultTcp) {
105  run_part1_EB(col);
106  run_part2(setup, col, towerMapEB_, result, resultTcp);
107 }
108 
109 //----------------------------------------------------------------------
111  EEDigiCollection const *col,
113  EcalTrigPrimDigiCollection &resultTcp) {
114  run_part1_EE(col);
115  run_part2(setup, col, towerMapEE_, result, resultTcp);
116 }
117 //----------------------------------------------------------------------
119  int stripnr;
120  int n = ((id.ic() - 1) % 100) / 20; // 20 corresponds to 4 * ecal_barrel_crystals_per_strip FIXME!!
121  if (id.ieta() < 0)
122  stripnr = n + 1;
123  else
124  stripnr = nbMaxStrips_ - n;
125  return stripnr;
126 }
127 //----------------------------------------------------------------------
129  int stripnr;
131  stripnr = elId.pseudoStripId();
132  return stripnr;
133 }
134 //----------------------------------------------------------------------
135 
138  // loop over dataframes and fill map
140 }
141 //----------------------------------------------------------------------
144  // loop over dataframes and fill map
146 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
EcalTrigPrimFunctionalAlgo::maxNrTPs_
static const unsigned int maxNrTPs_
Definition: EcalTrigPrimFunctionalAlgo.h:146
MessageLogger.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
EcalTrigPrimFunctionalAlgo::initStructures
void initStructures(std::vector< std::vector< std::pair< int, std::vector< T >>>> &towMap)
Definition: EcalTrigPrimFunctionalAlgo.h:323
EcalTrigPrimFunctionalAlgo::theEndcapGeometry
const CaloSubdetectorGeometry * theEndcapGeometry
Definition: EcalTrigPrimFunctionalAlgo.h:129
EcalTrigPrimFunctionalAlgo::maxNrTowers_
static const unsigned int maxNrTowers_
Definition: EcalTrigPrimFunctionalAlgo.h:145
EcalTriggerElectronicsId
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
Definition: EcalTriggerElectronicsId.h:18
EcalFenixStrip.h
EcalTrigPrimFunctionalAlgo::init
void init(const edm::EventSetup &)
Definition: EcalTrigPrimFunctionalAlgo.cc:68
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EBDetId
Definition: EBDetId.h:17
EcalTrigPrimFunctionalAlgo::run_part1_EB
void run_part1_EB(EBDigiCollection const *col)
Definition: EcalTrigPrimFunctionalAlgo.cc:136
EcalTrigPrimFunctionalAlgo::towerMapEE_
std::vector< std::vector< std::pair< int, std::vector< EEDataFrame > > > > towerMapEE_
Definition: EcalTrigPrimFunctionalAlgo.h:154
cuy.col
col
Definition: cuy.py:1010
EcalEndcapGeometryRecord
Definition: EcalEndcapGeometryRecord.h:23
EcalFenixTcp.h
edm::SortedCollection
Definition: SortedCollection.h:49
EcalTrigPrimFunctionalAlgo::clean
void clean(std::vector< std::vector< std::pair< int, std::vector< T >>>> &towerMap)
Definition: EcalTrigPrimFunctionalAlgo.h:314
EcalTrigPrimFunctionalAlgo::hitTowers_
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
Definition: EcalTrigPrimFunctionalAlgo.h:155
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
debug
#define debug
Definition: HDRShower.cc:19
EcalTrigPrimFunctionalAlgo::run
void run(const edm::EventSetup &, const EBDigiCollection *col, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
Definition: EcalTrigPrimFunctionalAlgo.cc:101
EcalTrigPrimFunctionalAlgo::towtp2_
std::vector< EcalTriggerPrimitiveSample > towtp2_
Definition: EcalTrigPrimFunctionalAlgo.h:157
EcalMappingRcd.h
edm::ESHandle< CaloGeometry >
EcalTrigPrimFunctionalAlgo::nrSamples_
static const unsigned int nrSamples_
Definition: EcalTrigPrimFunctionalAlgo.h:142
EEDetId
Definition: EEDetId.h:14
CaloGeometryRecord.h
EcalTrigTowerDetId.h
EcalSubdetector.h
EcalTrigPrimFunctionalAlgo::~EcalTrigPrimFunctionalAlgo
virtual ~EcalTrigPrimFunctionalAlgo()
Definition: EcalTrigPrimFunctionalAlgo.cc:96
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
EBDigiCollection
Definition: EcalDigiCollections.h:56
EcalTriggerElectronicsId::pseudoStripId
int pseudoStripId() const
get the tower id
Definition: EcalTriggerElectronicsId.h:35
EEDigiCollection
Definition: EcalDigiCollections.h:69
EcalElectronicsMapping.h
EcalTrigPrimFunctionalAlgo::eTTmap_
edm::ESHandle< EcalTrigTowerConstituentsMap > eTTmap_
Definition: EcalTrigPrimFunctionalAlgo.h:128
EcalTriggerElectronicsId.h
EcalElectronicsMapping::getTriggerElectronicsId
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
Definition: EcalElectronicsMapping.cc:389
EcalTPGPedestals.h
EcalTrigPrimFunctionalAlgo::nbMaxXtals_
Definition: EcalTrigPrimFunctionalAlgo.h:160
EcalFenixStrip
class representing the Fenix chip, format strip
Definition: EcalFenixStrip.h:30
EBDataFrame.h
edm::EventSetup
Definition: EventSetup.h:57
EcalTrigPrimFunctionalAlgo::findStripNr
int findStripNr(const EBDetId &id)
Definition: EcalTrigPrimFunctionalAlgo.cc:118
EcalTrigPrimFunctionalAlgo::binOfMaximum_
int binOfMaximum_
Definition: EcalTrigPrimFunctionalAlgo.h:134
get
#define get
EcalTrigPrimFunctionalAlgo::barrelOnly_
bool barrelOnly_
Definition: EcalTrigPrimFunctionalAlgo.h:138
EcalTrigPrimFunctionalAlgo::towerMapEB_
std::vector< std::vector< std::pair< int, std::vector< EBDataFrame > > > > towerMapEB_
Definition: EcalTrigPrimFunctionalAlgo.h:153
EEDataFrame.h
EcalTrigPrimFunctionalAlgo::estrip_
EcalFenixStrip * estrip_
Definition: EcalTrigPrimFunctionalAlgo.h:125
EcalTrigPrimFunctionalAlgo::fillMap
void fillMap(Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap)
Definition: EcalTrigPrimFunctionalAlgo.h:272
EcalTrigPrimFunctionalAlgo.h
EcalTrigPrimFunctionalAlgo::debug_
bool debug_
Definition: EcalTrigPrimFunctionalAlgo.h:139
EcalMappingRcd
Definition: EcalMappingRcd.h:15
EcalTrigPrimFunctionalAlgo::towtp_
std::vector< EcalTriggerPrimitiveSample > towtp_
Definition: EcalTrigPrimFunctionalAlgo.h:156
EcalTrigPrimFunctionalAlgo::nbMaxStrips_
Definition: EcalTrigPrimFunctionalAlgo.h:159
EcalTrigPrimFunctionalAlgo::etcp_
EcalFenixTcp * etcp_
Definition: EcalTrigPrimFunctionalAlgo.h:126
CaloGeometry.h
EcalTrigPrimFunctionalAlgo::maxNrSamples_
int maxNrSamples_
Definition: EcalTrigPrimFunctionalAlgo.h:135
EcalTrigPrimFunctionalAlgo::run_part1_EE
void run_part1_EE(EEDigiCollection const *col)
Definition: EcalTrigPrimFunctionalAlgo.cc:142
EcalTPGPedestalsRcd.h
mps_fire.result
result
Definition: mps_fire.py:311
EcalFenixTcp
class representing the Fenix chip, format strip
Definition: EcalFenixTcp.h:33
EcalTrigPrimFunctionalAlgo::theMapping_
const EcalElectronicsMapping * theMapping_
Definition: EcalTrigPrimFunctionalAlgo.h:130
EcalTrigPrimFunctionalAlgo::run_part2
void run_part2(const edm::EventSetup &, Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
Definition: EcalTrigPrimFunctionalAlgo.h:167
EcalTrigPrimFunctionalAlgo::tcpFormat_
bool tcpFormat_
Definition: EcalTrigPrimFunctionalAlgo.h:137
EcalTrigPrimFunctionalAlgo::maxNrSamplesOut_
static const unsigned int maxNrSamplesOut_
Definition: EcalTrigPrimFunctionalAlgo.h:144
EcalFenixLinearizer.h
EcalTrigPrimFunctionalAlgo::EcalTrigPrimFunctionalAlgo
EcalTrigPrimFunctionalAlgo(const edm::EventSetup &setup, int binofmax, bool tcpFormat, bool barrelOnly, bool debug, bool famos)
Definition: EcalTrigPrimFunctionalAlgo.cc:51
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
EcalTrigPrimFunctionalAlgo::famos_
bool famos_
Definition: EcalTrigPrimFunctionalAlgo.h:140