ATLAS Offline Software
Loading...
Searching...
No Matches
PileUpClassification Class Reference

Utilities to retrieve GenEvents according to their pile-up type from the McEventCollection. More...

#include <PileUpClassification.h>

Collaboration diagram for PileUpClassification:

Public Types

enum  PileuType_t {
  SIGNAL = 0 , ALL , INTIME , OUTOFTIME ,
  RESTOFMB , CAVERN , ALLMINBIAS , UNKONW = 9999
}
 define some Pile-up classification Important : this classification is copied in McParticleAlgs/python/JobOptCfg.py report any modification here to this jobOption ! More...
typedef enum PileUpClassification::PileuType_t PileuType_t
 define some Pile-up classification Important : this classification is copied in McParticleAlgs/python/JobOptCfg.py report any modification here to this jobOption !

Static Public Member Functions

static void findEventIterators (PileuType_t putype, McEventCollection::const_iterator &fEvt, McEventCollection::const_iterator &lEvt)
 Find interval [fEvt,lEvt] containing all GenEvents of type putype from the McEventCollection.
static void findEventIterators (PileuType_t putype, const McEventCollection *evts, size_t &firstIndex, size_t &lastIndex)
 Find interval [firstIndex,lastIndex] containing all GenEvents of type putype from the McEventCollection.
static PileuType_t pileUpType (const McEventCollection *evts, size_t evtIndex)
 Return the type of pile-up event of the GenEvent number evtIndex in the McEventCollection.
static void fillPileUpType (const McEventCollection *evts, std::vector< size_t > &evtToPUType)
 Fill evtToPUType so that entry i is the pile-up type of GenEvent number i inside the McEventCollection.

Detailed Description

Utilities to retrieve GenEvents according to their pile-up type from the McEventCollection.

The pile-up type is defined in https://twiki.cern.ch/twiki/bin/viewauth/Atlas/PileupDigitization#Arrangement_of_Truth_Information All utilities provided here rely on the above organisation.

Author
P.A. Delsart

Definition at line 23 of file PileUpClassification.h.

Member Typedef Documentation

◆ PileuType_t

define some Pile-up classification Important : this classification is copied in McParticleAlgs/python/JobOptCfg.py report any modification here to this jobOption !

Member Enumeration Documentation

◆ PileuType_t

define some Pile-up classification Important : this classification is copied in McParticleAlgs/python/JobOptCfg.py report any modification here to this jobOption !

Enumerator
SIGNAL 
ALL 
INTIME 
OUTOFTIME 
RESTOFMB 
CAVERN 
ALLMINBIAS 
UNKONW 

Definition at line 29 of file PileUpClassification.h.

Member Function Documentation

◆ fillPileUpType()

void PileUpClassification::fillPileUpType ( const McEventCollection * evts,
std::vector< size_t > & evtToPUType )
static

Fill evtToPUType so that entry i is the pile-up type of GenEvent number i inside the McEventCollection.

Definition at line 93 of file PileUpClassification.cxx.

93 {
94 evtToPUType.resize(evts->size());
97 // 1st GenEvent is always SIGNAL
98 evtToPUType[0] = SIGNAL; ++fEvt;
99 // increment automatically following GenEvents
101 int c=1;
102 for(; fEvt != lEvt; ++fEvt){
103 if(HepMC::signal_process_id(*fEvt) == 0 ) type= (PileuType_t)(type+1);
104 evtToPUType[c] = type;
105 c++;
106 }
107
108}
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
int signal_process_id(const GenEvent &e)
Definition GenEvent.h:636

◆ findEventIterators() [1/2]

void PileUpClassification::findEventIterators ( PileuType_t putype,
const McEventCollection * evts,
size_t & firstIndex,
size_t & lastIndex )
static

Find interval [firstIndex,lastIndex] containing all GenEvents of type putype from the McEventCollection.

Definition at line 66 of file PileUpClassification.cxx.

66 {
67
70 findEventIterators(putype, fEvt, lEvt);
71 firstIndex = fEvt - evts->begin();
72 lastIndex = lEvt - evts->begin();
73}
static void findEventIterators(PileuType_t putype, McEventCollection::const_iterator &fEvt, McEventCollection::const_iterator &lEvt)
Find interval [fEvt,lEvt] containing all GenEvents of type putype from the McEventCollection.

◆ findEventIterators() [2/2]

void PileUpClassification::findEventIterators ( PileuType_t putype,
McEventCollection::const_iterator & fEvt,
McEventCollection::const_iterator & lEvt )
static

Find interval [fEvt,lEvt] containing all GenEvents of type putype from the McEventCollection.

IMPORTANT : fEvt and lEvt are expected to be first and last iterators on the McEventCollection !

Definition at line 8 of file PileUpClassification.cxx.

8 {
9
10 McEventCollection::const_iterator maxIterator = lEvt;
11 //McEventCollection::const_iterator minIterator = fEvt;
12
13 int intervallN =-1; // -1 means no interval search.
14
15
16 switch(putype){
17 case SIGNAL:
18 lEvt = fEvt; ++lEvt;
19 break;
20 case ALL:
21 break;
22 case INTIME:
23 {
24 // Special case : there's no SEPARATOR between SIGNAL and INTIME :
25 ++fEvt; lEvt = fEvt; ++lEvt;
26 for(; lEvt < maxIterator; ++lEvt){
27 if(HepMC::signal_process_id(*lEvt) == 0 ) break;
28 }
29 break;
30 }
31 case OUTOFTIME:
32 intervallN = 1;
33 break;
34 case RESTOFMB:
35 intervallN = 2;
36 break;
37 case CAVERN:
38 intervallN = 3;
39 break;
40 case ALLMINBIAS:
41 ++fEvt;
42 break;
43 default:
44 break;
45 };
46
47
48 // if needed, search the correct interval
49 while(intervallN>0){
50 for(; fEvt < maxIterator; ++fEvt){
51 if( HepMC::signal_process_id(*fEvt) == 0 ) { ++fEvt; break; }
52 }
53 lEvt = fEvt;
54 for(; lEvt < maxIterator; ++lEvt){
55 if( HepMC::signal_process_id(*lEvt) == 0 ) break;
56 }
57 intervallN--;
58 }
59
60 // don't overstep your bounds!
61 if (lEvt>maxIterator) lEvt=maxIterator;
62 if (fEvt>maxIterator) fEvt=maxIterator;
63
64}

◆ pileUpType()

PileUpClassification::PileuType_t PileUpClassification::pileUpType ( const McEventCollection * evts,
size_t evtIndex )
static

Return the type of pile-up event of the GenEvent number evtIndex in the McEventCollection.

Definition at line 75 of file PileUpClassification.cxx.

75 {
76 if(evtIndex == 0 ) return SIGNAL;
77
81 ++itEvt;
83 while( itEvt != lEvt){
84 if( size_t(itEvt - fEvt) == evtIndex ){ return type ;}
85 ++itEvt;
86 if(HepMC::signal_process_id(*itEvt) == 0 ) { // a SEPARATOR
87 ++itEvt; type = (PileuType_t) (type+1);
88 }
89 }
90 return UNKONW;
91}

The documentation for this class was generated from the following files: