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  const HcalTrigTowerGeometry* trigTowerGeometry,
35  float rctlsb);
36 
38  void runFEFormatError(const FEDRawDataCollection* rawraw,
39  const HcalElectronicsMap* emap,
41  void setPeakFinderAlgorithm(int algo);
42  private:
43 
45  void addSignal(const HBHEDataFrame & frame);
46  void addSignal(const HFDataFrame & frame);
47  void addSignal(const IntegerCaloSamples & samples);
48  void addFG(const HcalTrigTowerDetId& id, std::vector<bool>& msb);
49 
51  void analyze(IntegerCaloSamples & samples, HcalTriggerPrimitiveDigi & result);
52  void analyzeHF(IntegerCaloSamples & samples, HcalTriggerPrimitiveDigi & result, float rctlsb);
53 
54  // Member initialized by constructor
57  double theThreshold;
58  bool peakfind_;
59  std::vector<double> weights_;
60  int latency_;
61  uint32_t FG_threshold_;
62  uint32_t ZS_threshold_;
68 
69  // Algo1: isPeak = TS[i-1] < TS[i] && TS[i] >= TS[i+1]
70  // Algo2: isPeak = TSS[i-1] < TSS[i] && TSS[i] >= TSS[i+1],
71  // TSS[i] = TS[i] + TS[i+1]
72  // Default: Algo2
74 
75  // Member not initialzed
76  //std::vector<HcalTrigTowerDetId> towerIds(const HcalDetId & id) const;
77 
79 
80  typedef std::map<HcalTrigTowerDetId, IntegerCaloSamples> SumMap;
82 
83  typedef std::vector<IntegerCaloSamples> SumFGContainer;
84  typedef std::map< HcalTrigTowerDetId, SumFGContainer > TowerMapFGSum;
86 
87  // ==============================
88  // = HF Veto
89  // ==============================
90  // Sum = Long + Short;" // intermediate calculation.
91  // if ((Short < MinSignalThresholdET OR Long < MinSignalThresholdET)
92  // AND Sum > PMTNoiseThresholdET) VetoedSum = 0;
93  // else VetoedSum = Sum;
94  // ==============================
95  // Map from FG id to veto booleans
96  typedef std::map<uint32_t, std::vector<bool> > TowerMapVeto;
98 
99  typedef std::map<HcalTrigTowerDetId, std::vector<bool> > FGbitMap;
101 };
102 #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
const HcalTPGCompressor * outcoder_
void addFG(const HcalTrigTowerDetId &id, std::vector< bool > &msb)
void run(const HcalTPGCoder *incoder, const HcalTPGCompressor *outcoder, const HBHEDigiCollection &hbheDigis, const HFDigiCollection &hfDigis, HcalTrigPrimDigiCollection &result, const HcalTrigTowerGeometry *trigTowerGeometry, float rctlsb)
void analyzeHF(IntegerCaloSamples &samples, HcalTriggerPrimitiveDigi &result, float rctlsb)
std::vector< IntegerCaloSamples > SumFGContainer
const HcalTrigTowerGeometry * theTrigTowerGeometry
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_
T w() const
void addSignal(const HBHEDataFrame &frame)
adds the signal to the map