Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:20:07

0001 #ifndef INTT_COMBINEDRAWDATADECODER_H
0002 #define INTT_COMBINEDRAWDATADECODER_H
0003 
0004 #include "InttBadChannelMap.h"
0005 #include "InttBCOMap.h"
0006 #include "InttDacMap.h"
0007 
0008 #include <cdbobjects/CDBTTree.h>
0009 #include <ffamodules/CDBInterface.h>
0010 #include <fun4all/SubsysReco.h>
0011 
0012 #include <set>
0013 #include <string>
0014 #include <vector>
0015 #include <map>
0016 
0017 class PHCompositeNode;
0018 class InttEventInfo;
0019 
0020 class InttCombinedRawDataDecoder : public SubsysReco
0021 {
0022  public:
0023   enum CalibRef
0024   {
0025     CDB = 0,
0026     FILE = 1,
0027   };
0028 
0029   InttCombinedRawDataDecoder(std::string const& name = "InttCombinedRawDataDecoder");
0030 
0031   int InitRun(PHCompositeNode*) override;
0032   int process_event(PHCompositeNode*) override;
0033 
0034   /// Overloaded; no arguments loads with default tag
0035   int LoadBadChannelMap() {return m_badmap.Load();}
0036   int LoadBadChannelMap(std::string const& s) {return m_badmap.Load(s);}
0037 
0038   /// Depreciated; use LoadHotChannelMap(const std::string&);
0039   int LoadHotChannelMapLocal(std::string const& s = "INTT_HotChannelMap.root") {return LoadBadChannelMap(s);}
0040   /// Depreciated; use LoadHotChannelMap(const std::string&);
0041   int LoadHotChannelMapRemote(std::string const& s = "INTT_HotChannelMap") {return LoadBadChannelMap(s);}
0042 
0043   void SetCalibDAC(std::string const& calibname = "INTT_DACMAP", const CalibRef& calibref = CDB)
0044   {
0045     m_calibinfoDAC = std::pair<std::string, CalibRef>(calibname, calibref);
0046   }
0047 
0048   void SetCalibBCO(std::string const& calibname = "INTT_BCOMAP", const CalibRef& calibref = CDB)
0049   {
0050     m_calibinfoBCO = std::pair<std::string, CalibRef>(calibname, calibref);
0051   }
0052   void useRawHitNodeName(const std::string& name) { m_InttRawNodeName = name; }
0053   void runInttStandalone(bool runAlone) { m_runStandAlone = runAlone; }
0054 
0055   void writeInttEventHeader(bool write) { m_writeInttEventHeader = write; }
0056 
0057   void set_inttFeeOffset(int offset) { m_inttFeeOffset = offset; }
0058   void set_outputBcoDiff(bool flag) {m_outputBcoDiff = flag; }
0059   void set_triggeredMode(bool flag) {m_triggeredMode = flag; }
0060   void set_bcoFilter(bool flag) {m_bcoFilter = flag; }
0061   void set_SaturatedChipRejection(bool flag){m_SaturatedChipRejection = flag;} // note : this is for removing a fraction of the saturated chips
0062   void set_HighChipMultiplicityCut(int cut){HighChipMultiplicityCut = cut;}
0063 
0064  private:
0065   InttEventInfo* intt_event_header = nullptr;
0066   std::string m_InttRawNodeName = "INTTRAWHIT";
0067   bool m_runStandAlone = false;
0068   bool m_writeInttEventHeader = false;
0069   bool m_bcoFilter = false;
0070   bool m_SaturatedChipRejection = true; // note : true as default
0071   std::pair<std::string, CalibRef> m_calibinfoDAC;
0072   std::pair<std::string, CalibRef> m_calibinfoBCO;
0073 
0074   InttBadChannelMap m_badmap;
0075   InttDacMap m_dacmap;
0076   InttBCOMap m_bcomap;
0077 
0078   int m_inttFeeOffset = 23;   //23 is the offset for INTT in streaming mode
0079   bool m_outputBcoDiff = false;
0080   bool m_triggeredMode = false;
0081 
0082   std::vector<std::string> evt_inttHits_vec;
0083   std::map<std::string, int> evt_ChipHit_count_map;
0084   int HighChipMultiplicityCut = 71;
0085 
0086 };
0087 
0088 #endif  // INTT_COMBINEDRAWDATADECODER_H