Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
18 m_ntpath =
"/NTUPLES/FILE1/SCDIGITS";
64 if ( ck.find(
"SC") == std::string::npos){
83 }
else if ( ck ==
"SC_ADC_BAS" ){
96 }
else if ( ck ==
"SC_ET" ){
103 if (
sc.isFailure()) {
108 if (
sc.isFailure()) {
113 }
else if ( ck ==
"SC_ET_ID" ){
116 if (
sc.isFailure()) {
121 if (
sc.isFailure()) {
126 if (
sc.isFailure()) {
135 if (
sc.isFailure()) {
142 if (
sc.isFailure()) {
148 if (
sc.isFailure()) {
153 if (
sc.isFailure()) {
161 if (
sc.isFailure()) {
171 if (
sc.isFailure()) {
176 if (
sc.isFailure()) {
181 if (
sc.isFailure()) {
186 if (
sc.isFailure()) {
191 if (
sc.isFailure()) {
197 return StatusCode::SUCCESS;
206 const EventContext& ctx = Gaudi::Hive::currentContext();
211 unsigned long long thisevent =
evt->eventNumber();
212 unsigned short thislb =
evt->lumiBlock();
215 unsigned long thisbcid =
evt->bcid();
216 unsigned long thisELVL1Id = 0;
217 unsigned long thisttype =
evt->level1TriggerType();
220 bool hasDigitContainer=
true;
226 hasDigitContainer=
false;
229 DigitContainer = hdlDigit.
cptr();
231 }
else hasDigitContainer=
false;
233 bool hasAccCalibDigitContainer=
true;
239 hasAccCalibDigitContainer=
false;
242 AccCalibDigitContainer = hdlAccDigit.
cptr();
244 }
else hasAccCalibDigitContainer=
false;
246 bool hasAccDigitContainer=
true;
252 hasAccDigitContainer=
false;
255 AccDigitContainer = hdlAccDigit.
cptr();
257 }
else hasAccDigitContainer=
false;
264 std::map<unsigned int, const LArLATOMEHeader*> LATOMEHeadMap;
268 sc =
evtStore()->retrieve(RawChannelContainer,
"LArRawChannels");
269 if (
sc.isFailure()) {
270 ATH_MSG_WARNING(
"Unable to retrieve LArRawChannelContainer with key LArRawChannels from DetectorStore. " );
273 ATH_MSG_DEBUG(
"Got LArRawChannelContainer with key LArRawChannels" );
277 ATH_MSG_WARNING(
"Asked for ETThresholdMain, but no LArRawChannelContainer, will not apply ! " );
282 sc =
evtStore()->retrieve(DigitContainer_next,
"SC_ADC_BAS");
283 if (
sc.isFailure()) {
284 ATH_MSG_WARNING(
"Unable to retrieve LArDigitContainer with key SC_ADC_BAS from DetectorStore. " );
287 ATH_MSG_DEBUG(
"Got additional LArDigitContainer with key SC_ADC_BAS " );
291 sc =
evtStore()->retrieve(etcontainer,
"SC_ET");
292 if (
sc.isFailure()) {
293 ATH_MSG_WARNING(
"Unable to retrieve LArRawSCContainer with key SC_ET from DetectorStore. " );
300 sc =
evtStore()->retrieve(etcontainer_next,
"SC_ET_ID");
301 if (
sc.isFailure()) {
302 ATH_MSG_WARNING(
"Unable to retrieve LArRawSCContainer with key SC_ET_ID from DetectorStore. " );
313 headcontainer=&*hdrCont;
314 if(headcontainer !=
nullptr && *hdrCont->
begin()) thisELVL1Id = (*hdrCont->
begin())->L1Id();
315 ATH_MSG_DEBUG(
" ELVL1I FROM LATOME HEADER " << thisELVL1Id );
320 LATOMEHeadMap.try_emplace ( hit->SourceId(), hit );
325 rawChannelMap.try_emplace( raw.channelID(), &raw );
335 return StatusCode::FAILURE;
338 cablingROD=*cablingHdlROD;
341 return StatusCode::FAILURE;
346 if( DigitContainer_next && DigitContainer_next->
empty() ) DigitContainer_next =
nullptr;
348 if( etcontainer && etcontainer->
empty() ) etcontainer =
nullptr;
350 if( etcontainer_next && etcontainer_next->
empty() ) etcontainer_next =
nullptr;
353 if (hasDigitContainer) {
354 if( !DigitContainer->
empty() ) cellsno = DigitContainer->
size();
356 ATH_MSG_WARNING(
"DigitContainer has zero size, but asked, will be not filled... ");
357 return StatusCode::SUCCESS;
360 ATH_MSG_DEBUG(
"DigitContainer has size: "<<cellsno<<
" hasDigitContainer: "<<hasDigitContainer);
362 if(
m_ETThresh > 0. && !etcontainer && !etcontainer_next) {
363 ATH_MSG_WARNING(
"Asked for ETThreshold, but no SC_ET* container, will not apply ! " );
373 if(
m_ADCThresh > 0. && ! DigitContainer&& !DigitContainer_next) {
374 ATH_MSG_WARNING(
"Asked for ADCThreshold, but no digits container, will not apply ! " );
378 if (hasAccCalibDigitContainer) {
379 if( !AccCalibDigitContainer->
empty() ) {
380 cellsno = AccCalibDigitContainer->
size();
381 ATH_MSG_DEBUG(
"AccCalibDigitContainer has size: "<<cellsno<<
" hasAccCalibDigitContainer: "<<hasAccCalibDigitContainer);
383 ATH_MSG_WARNING(
"AccCalibDigitContainer has zero size, but asked, will be not filled... ");
384 return StatusCode::SUCCESS;
387 if (hasAccDigitContainer) {
388 if( !AccDigitContainer->
empty() ) {
389 cellsno = AccDigitContainer->
size();
390 ATH_MSG_DEBUG(
"AccDigitContainer has size: "<<cellsno<<
" hasAccDigitContainer: "<<hasAccDigitContainer);
392 ATH_MSG_WARNING(
"AccDigitContainer has zero size, but asked, will be not filled... ");
393 return StatusCode::SUCCESS;
397 if (DigitContainer_next){
399 cellsno = DigitContainer_next->
size();
400 }
else if(DigitContainer_next->
size() != (
unsigned)cellsno ){
ATH_MSG_ERROR(
" NOOOOOOO! Different number of entries in DigitContainer_next"<< cellsno <<
" " << DigitContainer_next->
size() );
405 cellsno = etcontainer->
size();
406 }
else if(etcontainer->
size() != (
unsigned)cellsno ){
ATH_MSG_ERROR(
" NOOOOOOO! Different number of entries in etcontainer"<< cellsno <<
" " << etcontainer->
size() );
409 if (etcontainer_next){
411 cellsno = etcontainer_next->
size();
412 }
else if(etcontainer_next->
size() != (
unsigned)cellsno ){
ATH_MSG_ERROR(
" NOOOOOOO! Different number of entries in etcontainer_next"<< cellsno <<
" " << etcontainer_next->
size() );
415 unsigned cellCounter = 0;
418 for(
int c = 0;
c<cellsno;++
c ){
425 bool acceptETMain =
true;
427 if( hasAccDigitContainer ){
433 unsigned int trueMaxSample = digi->
nsample();
437 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 " );
447 for(
unsigned i = 0;
i<trueMaxSample;++
i) {
456 if( hasAccCalibDigitContainer ){
462 unsigned int trueMaxSample = digi->
nsamples();
466 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 " );
476 for(
unsigned i = 0;
i<trueMaxSample;++
i) {
488 if( hasDigitContainer ){
493 unsigned int trueMaxSample = digi->
nsamples();
497 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 " );
514 if(!acceptETMain)
continue;
518 for(
unsigned i = 0;
i<trueMaxSample;++
i) {
537 unsigned int trueMaxBcid = trueMaxSample;
538 if(trueMaxBcid > scdigi->
BCId().size()) trueMaxBcid=scdigi->
BCId().size();
539 for(
unsigned i = 0;
i<trueMaxBcid; ++
i){
551 if( DigitContainer_next ){
555 unsigned int trueMaxSample = digi->
nsamples();
559 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 " );
566 if( !hasDigitContainer){
570 if(!acceptETMain)
continue;
575 for(
unsigned i = 0;
i<trueMaxSample;++
i) {
582 if(!scdigi){
ATH_MSG_DEBUG(
" Can't cast digi to LArSCDigit*");
592 for(
unsigned i = 0;
i<trueMaxSample;++
i){
607 if ( !hasDigitContainer && !DigitContainer_next ){
619 if(!acceptETMain)
continue;
622 unsigned int truenet =
m_Net;
623 if(truenet > rawSC->
bcids().size()) truenet=rawSC->
bcids().size();
624 for(
unsigned i=0;
i<truenet;++
i){
629 for(
i=0;
i<truenet;++
i){
631 if(rawSC->
bcids().size()) {
641 if(
i<truenet)
continue;
643 if(truenet > rawSC->
satur().size()) truenet=rawSC->
satur().size();
644 for(
unsigned i = 0;
i<truenet;++
i){
653 if( etcontainer_next ){
656 if ( !hasDigitContainer && !DigitContainer_next && !etcontainer ){
668 if(!acceptETMain)
continue;
678 if(rawSC->
bcids().size()) {
688 if(i<rawSC->energies().
size()) {
699 if (
sc != StatusCode::SUCCESS) {
713 if( !
m_trigDec->getListOfTriggers(
x).empty() ){
732 for (
x = TTVector->
begin(); x < TTVector->
end(); ++
x ){
738 if(
count==20000)
break;
746 if (
sc != StatusCode::SUCCESS) {
752 ATH_MSG_DEBUG(
"LArSC2Ntuple has finished, filled " << cellCounter <<
" cells");
753 return StatusCode::SUCCESS;
759 const std::vector<Identifier> cellIds =
m_scidtool->superCellToOfflineID(offId);
763 for(
unsigned i=0;
i<cellIds.size(); ++
i ) {
765 if (hwcell.
is_valid() && (rawChanMap.count(hwcell) != 0) ) {
768 m_ROD_id[
i] = rawChanMap[hwcell]->hardwareID().get_identifier32().get_compact();
def retrieve(aClass, aKey=None)
Liquid Argon SuperCell raw data.
Data class for calibration ADC samples preprocessed by the DSP.
NTuple::Array< float > m_ROD_time
NTuple::Array< double > m_TTphi
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeyAdditional
Gaudi::Property< std::vector< std::string > > m_trigNames
NTuple::Item< unsigned int > m_dac
SG::ReadHandleKey< LArLATOMEHeaderContainer > m_LArLatomeHeaderContainerKey
NTuple::Item< unsigned long long > m_IEventEvt
Container class for LArAccumulatedDigit.
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
size_t nsamples() const
return number of samples
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
const CaloSuperCellDetDescrManager * m_caloMgrSC
const std::vector< short > & samples() const
const HWIdentifier & hardwareID() const
float mean(int n_min=-1, int n_max=-1) const
Calculates and returns the Mean value of ADC samples.
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.
uint16_t getIsPulsedInt() const
get the four bit int that tells which lines pulsed
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
void reduce(HepMC::GenEvent *ge, std::vector< HepMC::GenParticlePtr > toremove)
Remove unwanted particles from the event, collapsing the graph structure consistently.
@ Error
The sub-detector issued an error.
const HWIdentifier & hardwareID() const
Return HWIdentifier.
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
Gaudi::Property< float > m_ETThreshMain
NTuple::Array< int > m_TTEhad
NTuple::Item< short > m_bcid
Data class for ADC samples and autocorr preprocessed by the DSP.
NTuple::Array< int > m_TTEem
NTuple::Array< float > m_RMS
NTuple::Item< unsigned int > m_pulsed
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.
int nsample() const
return number of samples
NTuple::Item< uint32_t > m_LArEventBits
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< float > RMS() const
Calculates and returns the RMS value of each ADC sample.
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
SG::ReadHandleKey< LArAccumulatedDigitContainer > m_accContKey
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
NTuple::Array< unsigned short > m_bcidVec_ET
const HWIdentifier & hardwareID() const
Return HWIdentifier.
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?
float RMS(int n_min=-1, int n_max=-1) const
Calculates and returns the RMS value of ADC samples
void fill(H5::Group &out_file, size_t iterations)
NTuple::Array< float > m_ROD_id
Gaudi::Property< std::string > m_triggerTowerKey
std::vector< float > mean() const
Calculates and returns the Mean value of each ADC sample.
NTuple::Item< uint32_t > m_ntNTT
void fillRODEnergy(HWIdentifier SCId, rawChanMap_t &rawChanMap, const LArOnOffIdMapping *cabling, const LArOnOffIdMapping *cablingROD, bool &acceptMain)
SG::ReadHandleKey< LArDigitContainer > m_contKey
StatusCode initialize(bool used=true)
NTuple::Array< float > m_ROD_energy
Gaudi::Property< float > m_ADCThresh
int delay() const
return the setting of the delay
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< float > m_ETThresh
NTuple::Item< unsigned int > m_delay
Gaudi::Property< bool > m_isSC
NTuple::Array< float > m_mean
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.
SG::ReadHandleKey< LArAccumulatedCalibDigitContainer > m_accCalibContKey
Container class for LArAccumulatedCalibDigit.
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.
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSCMgrKey
Container for LArRawChannel (IDC using LArRawChannelCollection)
const std::vector< int > & energies() const
int DAC() const
return the number of samples