Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:40

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 
0015 class PHCompositeNode;
0016 class InttEventInfo;
0017 
0018 class InttCombinedRawDataDecoder : public SubsysReco
0019 {
0020  public:
0021   enum CalibRef
0022   {
0023     CDB = 0,
0024     FILE = 1,
0025   };
0026 
0027   InttCombinedRawDataDecoder(std::string const& name = "InttCombinedRawDataDecoder");
0028 
0029   int InitRun(PHCompositeNode*) override;
0030   int process_event(PHCompositeNode*) override;
0031 
0032   /// Overloaded; no arguments loads with default tag
0033   int LoadBadChannelMap() {return m_badmap.Load();}
0034   int LoadBadChannelMap(std::string const& s) {return m_badmap.Load(s);}
0035 
0036   /// Depreciated; use LoadHotChannelMap(const std::string&);
0037   int LoadHotChannelMapLocal(std::string const& s = "INTT_HotChannelMap.root") {return LoadBadChannelMap(s);}
0038   /// Depreciated; use LoadHotChannelMap(const std::string&);
0039   int LoadHotChannelMapRemote(std::string const& s = "INTT_HotChannelMap") {return LoadBadChannelMap(s);}
0040 
0041   void SetCalibDAC(std::string const& calibname = "INTT_DACMAP", const CalibRef& calibref = CDB)
0042   {
0043     m_calibinfoDAC = std::pair<std::string, CalibRef>(calibname, calibref);
0044   }
0045 
0046   void SetCalibBCO(std::string const& calibname = "INTT_BCOMAP", const CalibRef& calibref = CDB)
0047   {
0048     m_calibinfoBCO = std::pair<std::string, CalibRef>(calibname, calibref);
0049   }
0050   void useRawHitNodeName(const std::string& name) { m_InttRawNodeName = name; }
0051   void runInttStandalone(bool runAlone) { m_runStandAlone = runAlone; }
0052 
0053   void writeInttEventHeader(bool write) { m_writeInttEventHeader = write; }
0054 
0055   void set_inttFeeOffset(int offset) { m_inttFeeOffset = offset; }
0056   void set_outputBcoDiff(bool flag) {m_outputBcoDiff = flag; }
0057   void set_triggeredMode(bool flag) {m_triggeredMode = flag; }
0058   void set_bcoFilter(bool flag) {m_bcoFilter = flag; }
0059  private:
0060   InttEventInfo* intt_event_header = nullptr;
0061   std::string m_InttRawNodeName = "INTTRAWHIT";
0062   bool m_runStandAlone = false;
0063   bool m_writeInttEventHeader = false;
0064   bool m_bcoFilter = false;
0065   std::pair<std::string, CalibRef> m_calibinfoDAC;
0066   std::pair<std::string, CalibRef> m_calibinfoBCO;
0067 
0068   InttBadChannelMap m_badmap;
0069   InttDacMap m_dacmap;
0070   InttBCOMap m_bcomap;
0071 
0072   int m_inttFeeOffset = 23;   //23 is the offset for INTT in streaming mode
0073   bool m_outputBcoDiff = false;
0074   bool m_triggeredMode = false;
0075 
0076 };
0077 
0078 #endif  // INTT_COMBINEDRAWDATADECODER_H