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 <string>
42 
43 const unsigned int EcalTrigPrimFunctionalAlgo::nrSamples_ = 5; // to be written
44 const unsigned int EcalTrigPrimFunctionalAlgo::maxNrSamplesOut_ = 10;
45 const unsigned int EcalTrigPrimFunctionalAlgo::maxNrTowers_ = 2448;
46 const unsigned int EcalTrigPrimFunctionalAlgo::maxNrTPs_ = 2448; // FIXME??
47 
48 //----------------------------------------------------------------------
49 
51  const CaloSubdetectorGeometry *endcapGeometry,
52  const EcalElectronicsMapping *theMapping,
53  int binofmax,
54  bool tcpFormat,
55  bool debug,
56  bool famos,
57  bool tpInfoPrintout)
58  : eTTmap_(eTTmap),
59  theEndcapGeometry_(endcapGeometry),
60  theMapping_(theMapping),
61  binOfMaximum_(binofmax),
62  tcpFormat_(tcpFormat),
63  barrelOnly_(true),
64  debug_(debug),
65  famos_(famos),
66  tpInfoPrintout_(tpInfoPrintout)
67 
68 {
69  if (famos_)
70  maxNrSamples_ = 1; // get from input??
71  else
72  maxNrSamples_ = 10;
73  this->init();
74 }
75 
77  const EcalElectronicsMapping *theMapping, int binofmax, bool tcpFormat, bool debug, bool famos, bool tpInfoPrintout)
78  : theMapping_(theMapping),
79  binOfMaximum_(binofmax),
80  tcpFormat_(tcpFormat),
81  barrelOnly_(true),
82  debug_(debug),
83  famos_(famos),
84  tpInfoPrintout_(tpInfoPrintout)
85 
86 {
87  if (famos_)
88  maxNrSamples_ = 1; // get from input??
89  else
90  maxNrSamples_ = 10;
91  this->init();
92 }
93 
94 //----------------------------------------------------------------------
96  // create main sub algos
97  estrip_ = std::make_unique<EcalFenixStrip>(theMapping_, debug_, famos_, maxNrSamples_, nbMaxXtals_, tpInfoPrintout_);
98  etcp_ = std::make_unique<EcalFenixTcp>(
100 
101  // initialise data structures
104 
105  hitTowers_.resize(maxNrTowers_);
106  towtp_.resize(maxNrSamplesOut_);
107  towtp2_.resize(maxNrSamplesOut_);
108 }
109 //----------------------------------------------------------------------
110 
112 //----------------------------------------------------------------------
115  EcalTrigPrimDigiCollection &resultTcp) {
116  run_part1_EB(col);
117  run_part2(col, towerMapEB_, result, resultTcp);
118 }
119 
120 //----------------------------------------------------------------------
123  EcalTrigPrimDigiCollection &resultTcp) {
124  run_part1_EE(col);
125  run_part2(col, towerMapEE_, result, resultTcp);
126 }
127 //----------------------------------------------------------------------
129  int stripnr;
130  int n = ((id.ic() - 1) % 100) / 20; // 20 corresponds to 4 * ecal_barrel_crystals_per_strip FIXME!!
131  if (id.ieta() < 0)
132  stripnr = n + 1;
133  else
134  stripnr = nbMaxStrips_ - n;
135  return stripnr;
136 }
137 //----------------------------------------------------------------------
139  int stripnr;
141  stripnr = elId.pseudoStripId();
142  return stripnr;
143 }
144 //----------------------------------------------------------------------
145 
148  // loop over dataframes and fill map
150 }
151 //----------------------------------------------------------------------
154  // loop over dataframes and fill map
156 }
EcalElectronicsMapping
Definition: EcalElectronicsMapping.h:28
EcalTrigPrimFunctionalAlgo::tpInfoPrintout_
bool tpInfoPrintout_
Definition: EcalTrigPrimFunctionalAlgo.h:156
EcalTrigPrimFunctionalAlgo::maxNrTPs_
static const unsigned int maxNrTPs_
Definition: EcalTrigPrimFunctionalAlgo.h:162
EcalTrigPrimFunctionalAlgo::nbMaxStrips_
Definition: EcalTrigPrimFunctionalAlgo.h:175
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:346
EcalTrigPrimFunctionalAlgo::maxNrTowers_
static const unsigned int maxNrTowers_
Definition: EcalTrigPrimFunctionalAlgo.h:161
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::EcalTrigPrimFunctionalAlgo
EcalTrigPrimFunctionalAlgo(const EcalTrigTowerConstituentsMap *eTTmap, const CaloSubdetectorGeometry *endcapGeometry, const EcalElectronicsMapping *theMapping, int binofmax, bool tcpFormat, bool debug, bool famos, bool TPinfoPrintout)
Definition: EcalTrigPrimFunctionalAlgo.cc:50
EBDetId
Definition: EBDetId.h:17
EcalTrigPrimFunctionalAlgo::run_part1_EB
void run_part1_EB(EBDigiCollection const *col)
Definition: EcalTrigPrimFunctionalAlgo.cc:146
EcalTrigPrimFunctionalAlgo::towerMapEE_
std::vector< std::vector< std::pair< int, std::vector< EEDataFrame > > > > towerMapEE_
Definition: EcalTrigPrimFunctionalAlgo.h:170
cuy.col
col
Definition: cuy.py:1010
EcalTrigPrimFunctionalAlgo::run_part2
void run_part2(Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
Definition: EcalTrigPrimFunctionalAlgo.h:183
EcalTrigPrimFunctionalAlgo::nbMaxXtals_
Definition: EcalTrigPrimFunctionalAlgo.h:176
EcalFenixTcp.h
edm::SortedCollection
Definition: SortedCollection.h:49
EcalTrigPrimFunctionalAlgo::init
void init()
Definition: EcalTrigPrimFunctionalAlgo.cc:95
EcalTrigPrimFunctionalAlgo::clean
void clean(std::vector< std::vector< std::pair< int, std::vector< T >>>> &towerMap)
Definition: EcalTrigPrimFunctionalAlgo.h:337
EcalTrigPrimFunctionalAlgo::hitTowers_
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
Definition: EcalTrigPrimFunctionalAlgo.h:171
EcalTrigPrimFunctionalAlgo::etcp_
std::unique_ptr< EcalFenixTcp > etcp_
Definition: EcalTrigPrimFunctionalAlgo.h:141
debug
#define debug
Definition: HDRShower.cc:19
EcalTrigPrimFunctionalAlgo::towtp2_
std::vector< EcalTriggerPrimitiveSample > towtp2_
Definition: EcalTrigPrimFunctionalAlgo.h:173
EcalMappingRcd.h
EcalTrigPrimFunctionalAlgo::nrSamples_
static const unsigned int nrSamples_
Definition: EcalTrigPrimFunctionalAlgo.h:158
EEDetId
Definition: EEDetId.h:14
CaloGeometryRecord.h
EcalTrigTowerDetId.h
EcalSubdetector.h
EcalTrigTowerConstituentsMap
Definition: EcalTrigTowerConstituentsMap.h:19
EcalTrigPrimFunctionalAlgo::~EcalTrigPrimFunctionalAlgo
virtual ~EcalTrigPrimFunctionalAlgo()
Definition: EcalTrigPrimFunctionalAlgo.cc:111
funct::true
true
Definition: Factorize.h:173
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
EcalTrigPrimFunctionalAlgo::estrip_
std::unique_ptr< EcalFenixStrip > estrip_
Definition: EcalTrigPrimFunctionalAlgo.h:140
EcalTrigPrimFunctionalAlgo::run
void run(const EBDigiCollection *col, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
Definition: EcalTrigPrimFunctionalAlgo.cc:113
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
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
EBDataFrame.h
EcalTrigPrimFunctionalAlgo::findStripNr
int findStripNr(const EBDetId &id)
Definition: EcalTrigPrimFunctionalAlgo.cc:128
EcalTrigPrimFunctionalAlgo::binOfMaximum_
int binOfMaximum_
Definition: EcalTrigPrimFunctionalAlgo.h:149
EcalTrigPrimFunctionalAlgo::towerMapEB_
std::vector< std::vector< std::pair< int, std::vector< EBDataFrame > > > > towerMapEB_
Definition: EcalTrigPrimFunctionalAlgo.h:169
EEDataFrame.h
EcalTrigPrimFunctionalAlgo::fillMap
void fillMap(Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap)
Definition: EcalTrigPrimFunctionalAlgo.h:295
EcalTrigPrimFunctionalAlgo.h
EcalTrigPrimFunctionalAlgo::debug_
bool debug_
Definition: EcalTrigPrimFunctionalAlgo.h:154
EcalTrigPrimFunctionalAlgo::towtp_
std::vector< EcalTriggerPrimitiveSample > towtp_
Definition: EcalTrigPrimFunctionalAlgo.h:172
CaloGeometry.h
EcalTrigPrimFunctionalAlgo::maxNrSamples_
int maxNrSamples_
Definition: EcalTrigPrimFunctionalAlgo.h:150
EcalTrigPrimFunctionalAlgo::run_part1_EE
void run_part1_EE(EEDigiCollection const *col)
Definition: EcalTrigPrimFunctionalAlgo.cc:152
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
EcalFenixLinearizer.h
EcalTPGPedestalsRcd.h
mps_fire.result
result
Definition: mps_fire.py:311
EcalTrigPrimFunctionalAlgo::theMapping_
const EcalElectronicsMapping * theMapping_
Definition: EcalTrigPrimFunctionalAlgo.h:145
EcalTrigPrimFunctionalAlgo::tcpFormat_
bool tcpFormat_
Definition: EcalTrigPrimFunctionalAlgo.h:152
EcalTrigPrimFunctionalAlgo::maxNrSamplesOut_
static const unsigned int maxNrSamplesOut_
Definition: EcalTrigPrimFunctionalAlgo.h:160
EcalTrigPrimFunctionalAlgo::famos_
bool famos_
Definition: EcalTrigPrimFunctionalAlgo.h:155