![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
16 m_ntpath =
"/NTUPLES/FILE1/SCDIGITS";
60 if ( ck.find(
"SC") == std::string::npos){
79 }
else if ( ck ==
"SC_ADC_BAS" ){
92 }
else if ( ck ==
"SC_ET" ){
104 if (
sc.isFailure()) {
109 }
else if ( ck ==
"SC_ET_ID" ){
112 if (
sc.isFailure()) {
117 if (
sc.isFailure()) {
122 if (
sc.isFailure()) {
131 if (
sc.isFailure()) {
138 if (
sc.isFailure()) {
144 if (
sc.isFailure()) {
149 if (
sc.isFailure()) {
157 if (
sc.isFailure()) {
167 if (
sc.isFailure()) {
172 if (
sc.isFailure()) {
177 if (
sc.isFailure()) {
182 if (
sc.isFailure()) {
187 if (
sc.isFailure()) {
193 return StatusCode::SUCCESS;
202 const EventContext& ctx = Gaudi::Hive::currentContext();
207 unsigned long long thisevent =
evt->eventNumber();
208 unsigned short thislb =
evt->lumiBlock();
211 unsigned long thisbcid =
evt->bcid();
212 unsigned long thisELVL1Id = 0;
213 unsigned long thisttype =
evt->level1TriggerType();
216 bool hasDigitContainer=
true;
222 hasDigitContainer=
false;
225 DigitContainer = hdlDigit.
cptr();
227 }
else hasDigitContainer=
false;
234 std::map<unsigned int, const LArLATOMEHeader*> LATOMEHeadMap;
238 sc =
evtStore()->retrieve(RawChannelContainer,
"LArRawChannels");
239 if (
sc.isFailure()) {
240 ATH_MSG_WARNING(
"Unable to retrieve LArRawChannelContainer with key LArRawChannels from DetectorStore. " );
243 ATH_MSG_DEBUG(
"Got LArRawChannelContainer with key LArRawChannels" );
247 sc =
evtStore()->retrieve(DigitContainer_next,
"SC_ADC_BAS");
248 if (
sc.isFailure()) {
249 ATH_MSG_WARNING(
"Unable to retrieve LArDigitContainer with key SC_ADC_BAS from DetectorStore. " );
252 ATH_MSG_DEBUG(
"Got additional LArDigitContainer with key SC_ADC_BAS " );
256 sc =
evtStore()->retrieve(etcontainer,
"SC_ET");
257 if (
sc.isFailure()) {
258 ATH_MSG_WARNING(
"Unable to retrieve LArRawSCContainer with key SC_ET from DetectorStore. " );
265 sc =
evtStore()->retrieve(etcontainer_next,
"SC_ET_ID");
266 if (
sc.isFailure()) {
267 ATH_MSG_WARNING(
"Unable to retrieve LArRawSCContainer with key SC_ET_ID from DetectorStore. " );
278 headcontainer=&*hdrCont;
279 thisELVL1Id = (*hdrCont->
begin())->L1Id();
280 ATH_MSG_DEBUG(
" ELVL1I FROM LATOME HEADER " << thisELVL1Id );
285 LATOMEHeadMap.try_emplace ( hit->SourceId(), hit );
290 rawChannelMap.try_emplace( raw.channelID(), &raw );
300 return StatusCode::FAILURE;
303 cablingROD=*cablingHdlROD;
306 return StatusCode::FAILURE;
311 if( DigitContainer_next && DigitContainer_next->
empty() ) DigitContainer_next =
nullptr;
313 if( etcontainer && etcontainer->
empty() ) etcontainer =
nullptr;
315 if( etcontainer_next && etcontainer_next->
empty() ) etcontainer_next =
nullptr;
318 if (hasDigitContainer) {
319 if( !DigitContainer->
empty() ) cellsno = DigitContainer->
size();
321 ATH_MSG_WARNING(
"DigitContainer has zero size, but asked, will be not filled... ");
322 return StatusCode::SUCCESS;
325 ATH_MSG_DEBUG(
"DigitContainer has size: "<<cellsno<<
" hasDigitContainer: "<<hasDigitContainer);
327 if (DigitContainer_next){
329 cellsno = DigitContainer_next->
size();
330 }
else if(DigitContainer_next->
size() != (
unsigned)cellsno ){
ATH_MSG_ERROR(
" NOOOOOOO! Different number of entries in DigitContainer_next"<< cellsno <<
" " << DigitContainer_next->
size() );
335 cellsno = etcontainer->
size();
336 }
else if(etcontainer->
size() != (
unsigned)cellsno ){
ATH_MSG_ERROR(
" NOOOOOOO! Different number of entries in etcontainer"<< cellsno <<
" " << etcontainer->
size() );
339 if (etcontainer_next){
341 cellsno = etcontainer_next->
size();
342 }
else if(etcontainer_next->
size() != (
unsigned)cellsno ){
ATH_MSG_ERROR(
" NOOOOOOO! Different number of entries in etcontainer_next"<< cellsno <<
" " << etcontainer_next->
size() );
345 unsigned cellCounter = 0;
347 for(
int c = 0;
c<cellsno;++
c ){
354 if( hasDigitContainer ){
365 unsigned int trueMaxSample = digi->
nsamples();
369 ATH_MSG_DEBUG(
"The number of samples in data is larger than the one specified by JO: " << trueMaxSample <<
" > " <<
m_Nsamples <<
" --> only " <<
m_Nsamples <<
" will be available in the ntuple " );
393 unsigned int trueMaxBcid = trueMaxSample;
394 if(trueMaxBcid > scdigi->
BCId().size()) trueMaxBcid=scdigi->
BCId().size();
395 for(
unsigned i = 0;
i<trueMaxBcid; ++
i){
410 if( DigitContainer_next ){
414 unsigned int trueMaxSample = digi->
nsamples();
418 ATH_MSG_DEBUG(
"The number of samples in data is larger than the one specified by JO: " << trueMaxSample <<
" > " <<
m_Nsamples <<
" --> only " <<
m_Nsamples <<
" will be available in the ntuple " );
425 if( !hasDigitContainer){
435 if(!scdigi){
ATH_MSG_DEBUG(
" Can't cast digi to LArSCDigit*");
445 for(
unsigned i = 0;
i<trueMaxSample;++
i){
451 if( !hasDigitContainer &&
m_fillRawChan && RawChannelContainer ){
459 if( DigitContainer_next ){
463 unsigned int trueMaxSample = digi->
nsamples();
467 ATH_MSG_DEBUG(
"The number of samples in data is larger than the one specified by JO: " << trueMaxSample <<
" > " <<
m_Nsamples <<
" --> only " <<
m_Nsamples <<
" will be available in the ntuple " );
475 if( !hasDigitContainer){
488 if ( !hasDigitContainer){
510 if ( !hasDigitContainer && !DigitContainer_next ){
524 unsigned int truenet =
m_Net;
525 if(truenet > rawSC->
bcids().size()) truenet=rawSC->
bcids().size();
526 for(
unsigned i=0;
i<truenet;++
i){
530 for(
unsigned i=0;
i<truenet;++
i){
533 if(truenet > rawSC->
satur().size()) truenet=rawSC->
satur().size();
534 for(
unsigned i = 0;
i<truenet;++
i){
542 if( etcontainer_next ){
545 if ( !hasDigitContainer && !DigitContainer_next && !etcontainer ){
571 if (
sc != StatusCode::SUCCESS) {
584 if( !
m_trigDec->getListOfTriggers(
x).empty() ){
602 for (
x = TTVector->
begin(); x < TTVector->
end(); ++
x ){
608 if(
count==20000)
break;
616 if (
sc != StatusCode::SUCCESS) {
622 ATH_MSG_DEBUG(
"LArSC2Ntuple has finished, filled " << cellCounter <<
" cells");
623 return StatusCode::SUCCESS;
629 const std::vector<Identifier> cellIds =
m_scidtool->superCellToOfflineID(offId);
633 for(
unsigned i=0;
i<cellIds.size(); ++
i ) {
635 if (hwcell.
is_valid() && (rawChanMap.count(hwcell) != 0) ) {
638 m_ROD_id[
i] = rawChanMap[hwcell]->hardwareID().get_identifier32().get_compact();
def retrieve(aClass, aKey=None)
Liquid Argon SuperCell raw data.
NTuple::Array< float > m_ROD_time
NTuple::Array< double > m_TTphi
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeyAdditional
Gaudi::Property< std::vector< std::string > > m_trigNames
SG::ReadHandleKey< LArLATOMEHeaderContainer > m_LArLatomeHeaderContainerKey
NTuple::Item< unsigned long long > m_IEventEvt
std::string find(const std::string &s)
return a remapped string
const_pointer_type cptr()
Dereference the pointer.
NTuple::Array< short > m_samples_ADC_BAS
Gaudi::Property< unsigned int > m_Nsamples
unsigned int SourceId() const
NTuple::Item< uint16_t > m_bcidLATOMEHEAD
Gaudi::Property< bool > m_fillBCID
Container class for LArRawSC.
const HWIdentifier & hardwareID() const
Gaudi::Property< bool > m_fillLB
const std::vector< short > & samples() const
const HWIdentifier & hardwareID() const
NTuple::Array< int > m_energyVec_ET_ID
NTuple::Item< unsigned long long > m_IEvent
NTuple::Array< unsigned short > m_bcidVec
const std::string & key() const
Return the StoreGate ID for the referenced object.
std::map< HWIdentifier, const LArRawChannel * > rawChanMap_t
NTuple::Item< uint32_t > m_ntNet
unsigned int SourceId() const
@ LAr
The LAr calorimeter.
bool is_valid() const
Check if id is in a valid state.
NTuple::Item< long > m_ntNsamples
NTuple::Item< unsigned long > m_ELVL1Id
const std::vector< bool > & satur() const
const SG::ReadCondHandleKey< LArOnOffIdMapping > & cablingKey() const
@ Error
The sub-detector issued an error.
LArSC2Ntuple(const std::string &name, ISvcLocator *pSvcLocator)
NTuple::Array< bool > m_saturVec_ET
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
NTuple::Array< bool > m_saturVec_ET_ID
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Gaudi::Property< std::vector< unsigned int > > m_FTlist
NTuple::Array< int > m_TTEhad
NTuple::Item< short > m_bcid
NTuple::Array< int > m_TTEem
NTuple::Array< unsigned short > m_bcidVec_ET_ID
Liquid Argon digit base class.
NTuple::Item< uint32_t > m_latomeSourceId
Liquid Argon ROD output object base class.
NTuple::Item< uint32_t > m_LArEventBits
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< bool > m_fillRawChan
Gaudi::Property< bool > m_fillTType
SG::ReadDecorHandleKey< xAOD::EventInfo > m_eventInfoDecorKey
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode execute() override
ToolHandle< Trig::TrigDecisionTool > m_trigDec
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
NTuple::Item< short > m_latomeChannel
NTuple::Array< int > m_energyVec_ET
Gaudi::Property< bool > m_overwriteEventNumber
NTuple::Item< unsigned int > m_TType
void fillRODEnergy(HWIdentifier SCId, rawChanMap_t &rawChanMap, const LArOnOffIdMapping *cabling, const LArOnOffIdMapping *cablingROD)
NTuple::Array< unsigned short > m_bcidVec_ET
HWIdentifier createSignalChannelID(const Identifier &id) const
create a HWIdentifier from an Identifier (not inline)
Gaudi::Property< std::vector< std::string > > m_contKeys
Base class for LArDigits taken by LATOME.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
NTuple::Array< float > m_ROD_id
Gaudi::Property< std::string > m_triggerTowerKey
NTuple::Item< uint32_t > m_ntNTT
SG::ReadHandleKey< LArDigitContainer > m_contKey
StatusCode initialize(bool used=true)
NTuple::Array< float > m_ROD_energy
const std::vector< unsigned short > & bcids() const
ToolHandle< ICaloSuperCellIDTool > m_scidtool
bool fillFromIdentifier(const HWIdentifier &id)
@ Warning
The sub-detector issued a warning.
virtual StatusCode initialize()
#define ATH_MSG_WARNING(x)
Gaudi::Property< bool > m_isSC
NTuple::Array< short > m_samples
Container class for LArDigit.
virtual StatusCode initialize() override
Gaudi::Property< unsigned int > m_Net
NTuple::Array< unsigned short > m_bcidVec_ADC_BAS
const T * at(size_type n) const
Access an element, as an rvalue.
const std::vector< unsigned short > & BCId() const
size_type size() const noexcept
Returns the number of elements in the collection.
NTuple::Item< short > m_LArInError
NTuple::Item< long > m_FT
NTuple::Item< short > m_LB
NTuple::Array< double > m_TTeta
bool empty() const noexcept
Returns true if the collection is empty.
std::map< std::string, NTuple::Item< unsigned int > > m_trigNameMap
Gaudi::Property< bool > m_fillCaloTT
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Container for LArRawChannel (IDC using LArRawChannelCollection)
const std::vector< int > & energies() const