CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalTriggerPrimitiveAlgo.h
Go to the documentation of this file.
1 #ifndef HcalSimAlgos_HcalTriggerPrimitiveAlgo_h
2 #define HcalSimAlgos_HcalTriggerPrimitiveAlgo_h
3 
9 //#include "CalibFormats/HcalObjects/interface/HcalTPGCoder.h"
14 
15 #include <map>
16 #include <vector>
17 class CaloGeometry;
18 class IntegerCaloSamples;
19 
21 public:
22  HcalTriggerPrimitiveAlgo(bool pf, const std::vector<double>& w,
23  int latency,
24  uint32_t FG_threshold, uint32_t ZS_threshold,
25  int numberOfSamples, int numberOfPresamples,
26  uint32_t minSignalThreshold=0, uint32_t PMT_NoiseThreshold=0);
28 
29  void run(const HcalTPGCoder* incoder,
30  const HcalTPGCompressor* outcoder,
31  const HBHEDigiCollection& hbheDigis,
32  const HFDigiCollection& hfDigis,
34  float rctlsb);
35 
37  void runFEFormatError(const FEDRawDataCollection* rawraw,
38  const HcalElectronicsMap* emap,
40  void setPeakFinderAlgorithm(int algo);
41  private:
42 
44  void addSignal(const HBHEDataFrame & frame);
45  void addSignal(const HFDataFrame & frame);
46  void addSignal(const IntegerCaloSamples & samples);
47  void addFG(const HcalTrigTowerDetId& id, std::vector<bool>& msb);
48 
50  void analyze(IntegerCaloSamples & samples, HcalTriggerPrimitiveDigi & result);
51  void analyzeHF(IntegerCaloSamples & samples, HcalTriggerPrimitiveDigi & result, float rctlsb);
52 
53  // Member initialized by constructor
56  double theThreshold;
57  bool peakfind_;
58  std::vector<double> weights_;
59  int latency_;
60  uint32_t FG_threshold_;
61  uint32_t ZS_threshold_;
67 
68  // Algo1: isPeak = TS[i-1] < TS[i] && TS[i] >= TS[i+1]
69  // Algo2: isPeak = TSS[i-1] < TSS[i] && TSS[i] >= TSS[i+1],
70  // TSS[i] = TS[i] + TS[i+1]
71  // Default: Algo2
73 
74  // Member not initialzed
75  //std::vector<HcalTrigTowerDetId> towerIds(const HcalDetId & id) const;
76 
77  HcalTrigTowerGeometry theTrigTowerGeometry; // from event setup eventually?
78 
79  typedef std::map<HcalTrigTowerDetId, IntegerCaloSamples> SumMap;
81 
82  typedef std::vector<IntegerCaloSamples> SumFGContainer;
83  typedef std::map< HcalTrigTowerDetId, SumFGContainer > TowerMapFGSum;
85 
86  // ==============================
87  // = HF Veto
88  // ==============================
89  // Sum = Long + Short;" // intermediate calculation.
90  // if ((Short < MinSignalThresholdET OR Long < MinSignalThresholdET)
91  // AND Sum > PMTNoiseThresholdET) VetoedSum = 0;
92  // else VetoedSum = Sum;
93  // ==============================
94  // Map from FG id to veto booleans
95  typedef std::map<uint32_t, std::vector<bool> > TowerMapVeto;
97 
98  typedef std::map<HcalTrigTowerDetId, std::vector<bool> > FGbitMap;
100 };
101 #endif
void analyze(IntegerCaloSamples &samples, HcalTriggerPrimitiveDigi &result)
adds the actual RecHits
void runFEFormatError(const FEDRawDataCollection *rawraw, const HcalElectronicsMap *emap, HcalTrigPrimDigiCollection &result)
std::map< uint32_t, std::vector< bool > > TowerMapVeto
void run(const HcalTPGCoder *incoder, const HcalTPGCompressor *outcoder, const HBHEDigiCollection &hbheDigis, const HFDigiCollection &hfDigis, HcalTrigPrimDigiCollection &result, float rctlsb)
const HcalTPGCompressor * outcoder_
void addFG(const HcalTrigTowerDetId &id, std::vector< bool > &msb)
void analyzeHF(IntegerCaloSamples &samples, HcalTriggerPrimitiveDigi &result, float rctlsb)
HcalTrigTowerGeometry theTrigTowerGeometry
std::vector< IntegerCaloSamples > SumFGContainer
tuple result
Definition: query.py:137
HcalTriggerPrimitiveAlgo(bool pf, const std::vector< double > &w, int latency, uint32_t FG_threshold, uint32_t ZS_threshold, int numberOfSamples, int numberOfPresamples, uint32_t minSignalThreshold=0, uint32_t PMT_NoiseThreshold=0)
std::vector< double > weights_
void runZS(HcalTrigPrimDigiCollection &tp)
std::map< HcalTrigTowerDetId, std::vector< bool > > FGbitMap
std::map< HcalTrigTowerDetId, SumFGContainer > TowerMapFGSum
std::map< HcalTrigTowerDetId, IntegerCaloSamples > SumMap
const HcaluLUTTPGCoder * incoder_
LimitAlgo * algo
Definition: Combine.cc:60
void addSignal(const HBHEDataFrame &frame)
adds the signal to the map
T w() const