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  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 ZS_threshold_;
85 
86  // Algo1: isPeak = TS[i-1] < TS[i] && TS[i] >= TS[i+1]
87  // Algo2: isPeak = TSS[i-1] < TSS[i] && TSS[i] >= TSS[i+1],
88  // TSS[i] = TS[i] + TS[i+1]
89  // Default: Algo2
91 
92  // Member not initialzed
93  //std::vector<HcalTrigTowerDetId> towerIds(const HcalDetId & id) const;
94 
96 
97  typedef std::map<HcalTrigTowerDetId, IntegerCaloSamples> SumMap;
99 
100  struct HFDetails {
105  };
106  typedef std::map<HcalTrigTowerDetId, std::map<uint32_t, HFDetails>> HFDetailMap;
108 
109  typedef std::vector<IntegerCaloSamples> SumFGContainer;
110  typedef std::map< HcalTrigTowerDetId, SumFGContainer > TowerMapFGSum;
112 
113  // ==============================
114  // = HF Veto
115  // ==============================
116  // Sum = Long + Short;" // intermediate calculation.
117  // if ((Short < MinSignalThresholdET OR Long < MinSignalThresholdET)
118  // AND Sum > PMTNoiseThresholdET) VetoedSum = 0;
119  // else VetoedSum = Sum;
120  // ==============================
121  // Map from FG id to veto booleans
123  typedef std::map<uint32_t, std::vector<bool> > TowerMapVeto;
125 
126  typedef std::map<HcalTrigTowerDetId, std::vector<bool> > FGbitMap;
128 };
129 #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)
tuple result
Definition: mps_fire.py:83
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)