Skip to content
Snippets Groups Projects
Commit 1b28728c authored by Administrator's avatar Administrator Committed by Florian Uhlig
Browse files

Convert old to new tof adressing scheme

Add code which automatically converts the old tof address scheme to
the new one for the the CbmTofDigi data class.
Since for some of the varibales less bits than before are
available a check was added which catches such cases and stop the
execution with an error message in such cases.
This is unfortunately not yet possible for CbmTofPoint and CbmTofHit.
For both data classes the address is a member of the base class and
it was not possible to change the value of the base class member in
the same way. When reading any old versions of both classes the
macro execution is stopped immediately with an error message.
parent 402d955e
No related branches found
No related tags found
1 merge request!138Final merge
......@@ -119,4 +119,52 @@
#pragma link C++ class CbmDigiVector < CbmPsdDigi> + ;
#pragma link C++ class vector < CbmEventStore> + ;
#pragma read sourceClass="CbmTofDigi" version="[1-2]" targetClass="CbmTofDigi" \
source="UInt_t fuAddress" target="fuAddress" \
include="Logger.h" \
code="{ UInt_t system = (onfile.fuAddress >> 0) & ((1 << 4) - 1); \
UInt_t smId = (onfile.fuAddress >> 4) & ((1 << 8) - 1); \
UInt_t smType = (onfile.fuAddress >> 12) & ((1 << 4) - 1); \
UInt_t rpcId = (onfile.fuAddress >> 16) & ((1 << 7) - 1); \
UInt_t chSide = (onfile.fuAddress >> 23) & ((1 << 1) - 1); \
UInt_t chId = (onfile.fuAddress >> 24) & ((1 << 8) - 1); \
if ( smId > 127 || rpcId > 63 || chId > 63 ) { \
LOG(error) << \"You are trying to read an outdated version of CbmTofDigi\"; \
LOG(error) << \"where the unique tof address can't be converted\"; \
LOG(error) << \"automatically to the new tof addressing scheme.\"; \
LOG(fatal) << \"Stop execution.\"; \
} \
UInt_t rpcType = 0; \
fuAddress = (system & ((1 << 4) - 1)) \
+ ((smId & ((1 << 7) - 1)) << 4) \
+ ((smType & ((1 << 4) - 1)) << 11) \
+ ((chSide & ((1 << 1) - 1)) << 21) \
+ ((rpcId & ((1 << 6) - 1)) << 15) \
+ ((chId & ((1 << 6) - 1)) << 22) \
+ ((rpcType & ((1 << 4) - 1)) << 28); \
}"
#pragma read sourceClass="CbmTofHit" version="[1-4]" targetClass="CbmTofHit" \
source="" target="" \
include="Logger.h" \
code="{ \
LOG(error); \
LOG(error) << \"You are trying to read an outdated version of CbmTofHit\"; \
LOG(error) << \"where the unique tof address can't be converted\"; \
LOG(error) << \"automatically to the new tof addressing scheme.\"; \
LOG(error); \
LOG(fatal) << \"Stop execution.\"; \
}"
#pragma read sourceClass="CbmTofPoint" version="[1-3]" targetClass="CbmTofPoint" \
source="" target="" \
include="Logger.h" \
code="{ \
LOG(error); \
LOG(error) << \"You are trying to read an outdated version of CbmTofPoint\"; \
LOG(error) << \"where the unique tof address can't be converted\"; \
LOG(error) << \"automatically to the new tof addressing scheme.\"; \
LOG(error); \
LOG(fatal) << \"Stop execution.\"; \
}"
#endif
......@@ -170,6 +170,6 @@ private:
ar& fdTot;
}
ClassDefNV(CbmTofDigi, 2);
ClassDefNV(CbmTofDigi, 3);
};
#endif // CBMTOFDIGI_H
......@@ -125,7 +125,7 @@ private:
ar& fChannel;
}
ClassDef(CbmTofHit, 4)
ClassDef(CbmTofHit, 5)
};
#endif
......@@ -131,7 +131,7 @@ private:
UShort_t fGapMask; /// Set of gaps traversed
ClassDef(CbmTofPoint, 3)
ClassDef(CbmTofPoint, 4)
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment