Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:48

0001 #ifndef _PHYSICSTOBITCONVERTER_h
0002 #define _PHYSICSTOBITCONVERTER_h
0003 
0004 #include <cstdio>
0005 #include <string>
0006 #include <cstdlib>
0007 #include <iostream>
0008 #include <fstream>
0009 #include <stdexcept>
0010 #include <cstdint>
0011 #include <iomanip>
0012 #include <sstream>
0013 #include <vector>
0014 #include <array>
0015 #include <bitset>
0016 #include <cstdint>
0017 #include <cmath>
0018 #include "rctDataBase.h"
0019 
0020 namespace l1t {
0021   class PhysicsToBitConverter {
0022     int words32bitLink[2][6];  //[link][word]

0023 
0024     int bitsLink[2][192];
0025     rctDataBase databaseobject;
0026 
0027   public:
0028     PhysicsToBitConverter();
0029     ~PhysicsToBitConverter() {}
0030     void Set32bitWordLinkEven(int index, uint32_t value) { words32bitLink[0][index] = value; };
0031     void Set32bitWordLinkOdd(int index, uint32_t value) { words32bitLink[1][index] = value; };
0032 
0033     int Get32bitWordLinkEven(int index) { return words32bitLink[0][index]; };
0034     int Get32bitWordLinkOdd(int index) { return words32bitLink[1][index]; };
0035 
0036     void Convert();
0037     void Extract32bitwords();
0038 
0039     int GetObject(rctDataBase::rctObjectType t, int firstindex, int secondindex = -1);
0040     void SetObject(rctDataBase::rctObjectType t, int value, int firstindex, int secondindex = -1);
0041 
0042     int ReadBitInInt(int bit, int value);
0043     int BuildDecimalValue(int firstbit, int bitlength, int linkid);
0044 
0045     int GetRCEt(int card, int region) { return GetObject(rctDataBase::RCEt, card, region); }
0046     int GetHFEt(int region) { return GetObject(rctDataBase::HFEt, region); }
0047     int GetRCTau(int card, int region) { return GetObject(rctDataBase::RCTau, card, region); }
0048     int GetRCOf(int card, int region) { return GetObject(rctDataBase::RCOf, card, region); }
0049     int GetHFFg(int region) { return GetObject(rctDataBase::HFFg, region); }
0050     int GetNEReg(int cand) { return GetObject(rctDataBase::NEReg, cand); }
0051     int GetNECard(int cand) { return GetObject(rctDataBase::NECard, cand); }
0052     int GetNEEt(int cand) { return GetObject(rctDataBase::NEEt, cand); }
0053     int GetIEReg(int cand) { return GetObject(rctDataBase::IEReg, cand); }
0054     int GetIECard(int cand) { return GetObject(rctDataBase::IECard, cand); }
0055     int GetIEEt(int cand) { return GetObject(rctDataBase::IEEt, cand); }
0056     int GetRCHad(int card, int region) { return GetObject(rctDataBase::RCHad, card, region); }
0057 
0058     void SetRCEt(int value, int card, int region) { SetObject(rctDataBase::RCEt, value, card, region); }
0059     void SetHFEt(int value, int region) { SetObject(rctDataBase::HFEt, value, region); }
0060     void SetRCTau(int value, int card, int region) { SetObject(rctDataBase::RCTau, value, card, region); }
0061     void SetRCOf(int value, int card, int region) { SetObject(rctDataBase::RCOf, value, card, region); }
0062     void SetHFFg(int value, int region) { SetObject(rctDataBase::HFFg, value, region); }
0063     void SetNEReg(int value, int cand) { SetObject(rctDataBase::NEReg, value, cand); }
0064     void SetNECard(int value, int cand) { SetObject(rctDataBase::NECard, value, cand); }
0065     void SetNEEt(int value, int cand) { SetObject(rctDataBase::NEEt, value, cand); }
0066     void SetIEReg(int value, int cand) { SetObject(rctDataBase::IEReg, value, cand); }
0067     void SetIECard(int value, int cand) { SetObject(rctDataBase::IECard, value, cand); }
0068     void SetIEEt(int value, int cand) { SetObject(rctDataBase::IEEt, value, cand); }
0069     void SetRCHad(int value, int card, int region) { SetObject(rctDataBase::RCHad, value, card, region); }
0070   };
0071 }  // namespace l1t

0072 #endif