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  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(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_threshold_;
63  uint32_t ZS_threshold_;
71 
72  // Algo1: isPeak = TS[i-1] < TS[i] && TS[i] >= TS[i+1]
73  // Algo2: isPeak = TSS[i-1] < TSS[i] && TSS[i] >= TSS[i+1],
74  // TSS[i] = TS[i] + TS[i+1]
75  // Default: Algo2
77 
78  // Member not initialzed
79  //std::vector<HcalTrigTowerDetId> towerIds(const HcalDetId & id) const;
80 
82 
83  typedef std::map<HcalTrigTowerDetId, IntegerCaloSamples> SumMap;
85 
86  typedef std::vector<IntegerCaloSamples> SumFGContainer;
87  typedef std::map< HcalTrigTowerDetId, SumFGContainer > TowerMapFGSum;
89 
90  // ==============================
91  // = HF Veto
92  // ==============================
93  // Sum = Long + Short;" // intermediate calculation.
94  // if ((Short < MinSignalThresholdET OR Long < MinSignalThresholdET)
95  // AND Sum > PMTNoiseThresholdET) VetoedSum = 0;
96  // else VetoedSum = Sum;
97  // ==============================
98  // Map from FG id to veto booleans
99  typedef std::map<uint32_t, std::vector<bool> > TowerMapVeto;
101 
102  typedef std::map<HcalTrigTowerDetId, std::vector<bool> > FGbitMap;
104 };
105 #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
HcalTriggerPrimitiveAlgo(bool pf, const std::vector< double > &w, int latency, uint32_t FG_threshold, uint32_t ZS_threshold, int numberOfSamples, int numberOfPresamples, int numberOfSamplesHF, int numberOfPresamplesHF, uint32_t minSignalThreshold=0, uint32_t PMT_NoiseThreshold=0)
const double w
Definition: UKUtility.cc:23
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
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