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 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  private:
45 
47  void addSignal(const HBHEDataFrame & frame);
48  void addSignal(const HFDataFrame & frame);
49  void addSignal(const IntegerCaloSamples & samples);
50  void addFG(const HcalTrigTowerDetId& id, std::vector<bool>& msb);
51 
53  void analyze(IntegerCaloSamples & samples, HcalTriggerPrimitiveDigi & result);
54  // Version 0: RCT
55  void analyzeHF(IntegerCaloSamples & samples, HcalTriggerPrimitiveDigi & result, const int hf_lumi_shift);
56  // Version 1: 1x1
57  void analyzeHFV1(
58  const IntegerCaloSamples& SAMPLES,
60  const int HF_LUMI_SHIFT,
61  const HcalFeatureBit* HCALFEM
62  );
63 
64  // Member initialized by constructor
67  double theThreshold;
68  bool peakfind_;
69  std::vector<double> weights_;
70  int latency_;
71  uint32_t FG_threshold_;
72  uint32_t ZS_threshold_;
80 
81  // Algo1: isPeak = TS[i-1] < TS[i] && TS[i] >= TS[i+1]
82  // Algo2: isPeak = TSS[i-1] < TSS[i] && TSS[i] >= TSS[i+1],
83  // TSS[i] = TS[i] + TS[i+1]
84  // Default: Algo2
86 
87  // Member not initialzed
88  //std::vector<HcalTrigTowerDetId> towerIds(const HcalDetId & id) const;
89 
91 
92  typedef std::map<HcalTrigTowerDetId, IntegerCaloSamples> SumMap;
94 
95  struct HFDetails {
100  };
101  typedef std::map<HcalTrigTowerDetId, std::map<uint32_t, HFDetails>> HFDetailMap;
103 
104  typedef std::vector<IntegerCaloSamples> SumFGContainer;
105  typedef std::map< HcalTrigTowerDetId, SumFGContainer > TowerMapFGSum;
107 
108  // ==============================
109  // = HF Veto
110  // ==============================
111  // Sum = Long + Short;" // intermediate calculation.
112  // if ((Short < MinSignalThresholdET OR Long < MinSignalThresholdET)
113  // AND Sum > PMTNoiseThresholdET) VetoedSum = 0;
114  // else VetoedSum = Sum;
115  // ==============================
116  // Map from FG id to veto booleans
118  typedef std::map<uint32_t, std::vector<bool> > TowerMapVeto;
120 
121  typedef std::map<HcalTrigTowerDetId, std::vector<bool> > FGbitMap;
123 };
124 #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 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)
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
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)