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_threshold1, uint32_t FG_threshold2, uint32_t ZS_threshold,
25  int numberOfSamples, int numberOfPresamples,
26  int numberOfSamplesHF, int numberOfPresamplesHF,
27  uint32_t minSignalThreshold=0, uint32_t PMT_NoiseThreshold=0);
29 
30  void run(const HcalTPGCoder* incoder,
31  const HcalTPGCompressor* outcoder,
32  const HBHEDigiCollection& hbheDigis,
33  const HFDigiCollection& hfDigis,
35  const HcalTrigTowerGeometry* trigTowerGeometry,
36  float rctlsb);
37 
39  void runFEFormatError(const FEDRawDataCollection* rawraw,
40  const HcalElectronicsMap* emap,
42  void setPeakFinderAlgorithm(int algo);
43  private:
44 
46  void addSignal(const HBHEDataFrame & frame);
47  void addSignal(const HFDataFrame & frame);
48  void addSignal(const IntegerCaloSamples & samples);
49  void addFG(const HcalTrigTowerDetId& id, std::vector<bool>& msb);
50 
52  void analyze(IntegerCaloSamples & samples, HcalTriggerPrimitiveDigi & result);
53  void analyzeHF(int ieta, int iphi, int (&FGBit)[18][22], IntegerCaloSamples & samples, HcalTriggerPrimitiveDigi & result, float rctlsb);
54 
55  // Member initialized by constructor
58  double theThreshold;
59  bool peakfind_;
60  std::vector<double> weights_;
61  int latency_;
62  uint32_t FG_threshold1_;
63  uint32_t FG_threshold2_;
64  uint32_t ZS_threshold_;
72 
73  // Algo1: isPeak = TS[i-1] < TS[i] && TS[i] >= TS[i+1]
74  // Algo2: isPeak = TSS[i-1] < TSS[i] && TSS[i] >= TSS[i+1],
75  // TSS[i] = TS[i] + TS[i+1]
76  // Default: Algo2
78 
79  // Member not initialzed
80  //std::vector<HcalTrigTowerDetId> towerIds(const HcalDetId & id) const;
81 
83 
84  typedef std::map<HcalTrigTowerDetId, IntegerCaloSamples> SumMap;
86 
87  typedef std::vector<IntegerCaloSamples> SumFGContainer;
88  typedef std::map< HcalTrigTowerDetId, SumFGContainer > TowerMapFGSum;
90 
91  // ==============================
92  // = HF Veto
93  // ==============================
94  // Sum = Long + Short;" // intermediate calculation.
95  // if ((Short < MinSignalThresholdET OR Long < MinSignalThresholdET)
96  // AND Sum > PMTNoiseThresholdET) VetoedSum = 0;
97  // else VetoedSum = Sum;
98  // ==============================
99  // Map from FG id to veto booleans
100  typedef std::map<uint32_t, std::vector<bool> > TowerMapVeto;
102 
103  typedef std::map<HcalTrigTowerDetId, std::vector<bool> > FGbitMap;
105 };
106 #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 double w
Definition: UKUtility.cc:23
void analyzeHF(int ieta, int iphi, int(&FGBit)[18][22], IntegerCaloSamples &samples, HcalTriggerPrimitiveDigi &result, float rctlsb)
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)
HcalTriggerPrimitiveAlgo(bool pf, const std::vector< double > &w, int latency, uint32_t FG_threshold1, uint32_t FG_threshold2, uint32_t ZS_threshold, int numberOfSamples, int numberOfPresamples, int numberOfSamplesHF, int numberOfPresamplesHF, uint32_t minSignalThreshold=0, uint32_t PMT_NoiseThreshold=0)
std::vector< IntegerCaloSamples > SumFGContainer
const HcalTrigTowerGeometry * theTrigTowerGeometry
tuple result
Definition: query.py:137
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_
void addSignal(const HBHEDataFrame &frame)
adds the signal to the map