test
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 
14 #include "SimCalorimetry/HcalTrigPrimAlgos/interface/HcalFeatureHFEMBit.h"//cuts based on short and long energy deposited.
15 
16 #include <map>
17 #include <vector>
18 class CaloGeometry;
19 class IntegerCaloSamples;
20 
22 public:
23  HcalTriggerPrimitiveAlgo(bool pf, const std::vector<double>& w,
24  int latency,
25  uint32_t FG_threshold, uint32_t FG_HF_threshold, uint32_t ZS_threshold,
26  int numberOfSamples, int numberOfPresamples,
27  int numberOfSamplesHF, int numberOfPresamplesHF,
28  uint32_t minSignalThreshold=0, uint32_t PMT_NoiseThreshold=0);
30 
31  void run(const HcalTPGCoder* incoder,
32  const HcalTPGCompressor* outcoder,
33  const HBHEDigiCollection& hbheDigis,
34  const HFDigiCollection& hfDigis,
36  const HcalTrigTowerGeometry* trigTowerGeometry,
37  float rctlsb, const HcalFeatureBit* LongvrsShortCut=0);
38 
40  void runFEFormatError(const FEDRawDataCollection* rawraw,
41  const HcalElectronicsMap* emap,
43  void setPeakFinderAlgorithm(int algo);
44  void setNCTScaleShift(int);
45  void setRCTScaleShift(int);
46 
47  private:
48 
50  void addSignal(const HBHEDataFrame & frame);
51  void addSignal(const HFDataFrame & frame);
52  void addSignal(const IntegerCaloSamples & samples);
53  void addFG(const HcalTrigTowerDetId& id, std::vector<bool>& msb);
54 
56  void analyze(IntegerCaloSamples & samples, HcalTriggerPrimitiveDigi & result);
57  // Version 0: RCT
58  void analyzeHF(IntegerCaloSamples & samples, HcalTriggerPrimitiveDigi & result, const int hf_lumi_shift);
59  // Version 1: 1x1
60  void analyzeHFV1(
61  const IntegerCaloSamples& SAMPLES,
63  const int HF_LUMI_SHIFT,
64  const HcalFeatureBit* HCALFEM
65  );
66 
67  // Member initialized by constructor
70  double theThreshold;
71  bool peakfind_;
72  std::vector<double> weights_;
73  int latency_;
74  uint32_t FG_threshold_;
75  uint32_t FG_HF_threshold_;
76  uint32_t ZS_threshold_;
86 
87  // Algo1: isPeak = TS[i-1] < TS[i] && TS[i] >= TS[i+1]
88  // Algo2: isPeak = TSS[i-1] < TSS[i] && TSS[i] >= TSS[i+1],
89  // TSS[i] = TS[i] + TS[i+1]
90  // Default: Algo2
92 
93  // Member not initialzed
94  //std::vector<HcalTrigTowerDetId> towerIds(const HcalDetId & id) const;
95 
97 
98  typedef std::map<HcalTrigTowerDetId, IntegerCaloSamples> SumMap;
100 
101  struct HFDetails {
106  };
107  typedef std::map<HcalTrigTowerDetId, std::map<uint32_t, HFDetails>> HFDetailMap;
109 
110  typedef std::vector<IntegerCaloSamples> SumFGContainer;
111  typedef std::map< HcalTrigTowerDetId, SumFGContainer > TowerMapFGSum;
113 
114  // ==============================
115  // = HF Veto
116  // ==============================
117  // Sum = Long + Short;" // intermediate calculation.
118  // if ((Short < MinSignalThresholdET OR Long < MinSignalThresholdET)
119  // AND Sum > PMTNoiseThresholdET) VetoedSum = 0;
120  // else VetoedSum = Sum;
121  // ==============================
122  // Map from FG id to veto booleans
124  typedef std::map<uint32_t, std::vector<bool> > TowerMapVeto;
126 
127  typedef std::map<HcalTrigTowerDetId, std::vector<bool> > FGbitMap;
129 };
130 #endif
void analyzeHFV1(const IntegerCaloSamples &SAMPLES, HcalTriggerPrimitiveDigi &result, const int HF_LUMI_SHIFT, const HcalFeatureBit *HCALFEM)
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 FG_HF_threshold, uint32_t ZS_threshold, int numberOfSamples, int numberOfPresamples, int numberOfSamplesHF, int numberOfPresamplesHF, uint32_t minSignalThreshold=0, uint32_t PMT_NoiseThreshold=0)
void analyzeHF(IntegerCaloSamples &samples, HcalTriggerPrimitiveDigi &result, const int hf_lumi_shift)
const double w
Definition: UKUtility.cc:23
const HcalTPGCompressor * outcoder_
void addFG(const HcalTrigTowerDetId &id, std::vector< bool > &msb)
tuple result
Definition: mps_fire.py:84
std::vector< IntegerCaloSamples > SumFGContainer
const HcalTrigTowerGeometry * theTrigTowerGeometry
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
std::map< HcalTrigTowerDetId, std::map< uint32_t, HFDetails > > HFDetailMap
void run(const HcalTPGCoder *incoder, const HcalTPGCompressor *outcoder, const HBHEDigiCollection &hbheDigis, const HFDigiCollection &hfDigis, HcalTrigPrimDigiCollection &result, const HcalTrigTowerGeometry *trigTowerGeometry, float rctlsb, const HcalFeatureBit *LongvrsShortCut=0)