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 }
int pseudoStripId() const
get the tower id
const EcalElectronicsMapping * theMapping_
EcalTrigPrimFunctionalAlgo(const EcalTrigTowerConstituentsMap *eTTmap, const CaloSubdetectorGeometry *endcapGeometry, const EcalElectronicsMapping *theMapping, int binofmax, bool tcpFormat, bool debug, bool famos, bool TPinfoPrintout)
void fillMap(Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap)
std::unique_ptr< EcalFenixTcp > etcp_
void run_part2(Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
static const unsigned int maxNrSamplesOut_
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
std::vector< EcalTriggerPrimitiveSample > towtp_
static const unsigned int maxNrTowers_
void initStructures(std::vector< std::vector< std::pair< int, std::vector< T >>>> &towMap)
std::vector< std::vector< std::pair< int, std::vector< EBDataFrame > > > > towerMapEB_
void clean(std::vector< std::vector< std::pair< int, std::vector< T >>>> &towerMap)
#define debug
Definition: HDRShower.cc:19
static const unsigned int maxNrTPs_
std::vector< std::vector< std::pair< int, std::vector< EEDataFrame > > > > towerMapEE_
std::unique_ptr< EcalFenixStrip > estrip_
std::vector< EcalTriggerPrimitiveSample > towtp2_
void run_part1_EB(EBDigiCollection const *col)
col
Definition: cuy.py:1009
static const unsigned int nrSamples_
void run_part1_EE(EEDigiCollection const *col)
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
void run(const EBDigiCollection *col, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)