ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Generators
GeneratorObjectsAthenaPool
src
McEventCollectionCnv.cxx
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// McEventCollectionCnv.cxx
8
// Implementation file for class McEventCollectionCnv
9
// Author: S.Binet<binet@cern.ch>
11
12
// Framework includes
13
#include "GaudiKernel/MsgStream.h"
14
15
// GeneratorObjectsTPCnv includes
16
#include "
GeneratorObjectsTPCnv/McEventCollectionCnv_p1.h
"
17
#include "
GeneratorObjectsTPCnv/McEventCollectionCnv_p2.h
"
18
#include "
GeneratorObjectsTPCnv/McEventCollectionCnv_p3.h
"
19
#include "
GeneratorObjectsTPCnv/McEventCollectionCnv_p4.h
"
20
#include "
GeneratorObjectsTPCnv/McEventCollectionCnv_p5.h
"
21
#include "
GeneratorObjectsTPCnv/McEventCollectionCnv_p6.h
"
22
#include "
GeneratorObjectsTPCnv/McEventCollectionCnv_p7.h
"
23
24
// GeneratorObjectsAthenaPool includes
25
#include "
McEventCollectionCnv.h
"
26
27
McEventCollection_PERS
*
28
McEventCollectionCnv::createPersistent
(
McEventCollection
* transCont )
29
{
30
MsgStream
msg
( msgSvc(),
"McEventCollectionCnv"
);
31
32
McEventCollectionCnv_p6
cnv;
33
McEventCollection_PERS
*persObj = cnv.
createPersistent
( transCont,
msg
);
34
35
msg
<< MSG::DEBUG <<
"::createPersistent [Success]"
<<
endmsg
;
36
return
persObj;
37
}
38
39
McEventCollection
*
McEventCollectionCnv::createTransient
(
const
Token
* token)
40
{
41
MsgStream
msg
( msgSvc(),
"McEventCollectionConverter"
);
42
43
McEventCollection
*transObj = 0;
44
45
static
const
Guid
tr_guid(
"6DE62B45-7C72-4539-92F2-3A8E739A4AC3"
);
46
static
const
Guid
p1_guid(
"BF93438C-D1D3-4F1C-8850-EB690AB7C416"
);
47
static
const
Guid
p2_guid(
"851BB1D2-1964-4B0A-B83A-6BD596CFB5E2"
);
48
static
const
Guid
p3_guid(
"6FC41599-64D6-4DB9-973E-9493166F6291"
);
49
static
const
Guid
p4_guid(
"C517102A-94DE-407C-B07F-09BD81F6172E"
);
50
static
const
Guid
p5_guid(
"D52391A4-F951-46BF-A0D5-E407698D2917"
);
51
static
const
Guid
p6_guid(
"6B78A751-B31A-4597-BFB6-DDCE62646CF9"
);
52
static
const
Guid
p7_guid(
"A3A04C74-A278-4E35-ACF8-4C6B8C32FC56"
);
53
// Hook to disable datapool if we are doing pileup
54
bool
isPileup(
false
);
55
if
(serviceLocator()->existsService(
"PileUpEventLoopMgr"
)) {
56
isPileup=
true
;
57
msg
<< MSG::DEBUG <<
"Pile run, disable datapool for McEventCollection "
<<
endmsg
;
58
}
59
60
if
(
compareClassGuid
(token, tr_guid) ) {
61
62
// regular object from before the T/P separation
63
return
poolReadObject<McEventCollection>
(token);
64
65
}
else
if
(
compareClassGuid
(token, p1_guid) ) {
66
67
std::unique_ptr<McEventCollection_p1> persObj(
poolReadObject<McEventCollection_p1>
(token) );
68
McEventCollectionCnv_p1
cnv;
69
transObj = cnv.
createTransient
( persObj.get(),
msg
);
70
}
else
if
(
compareClassGuid
(token, p2_guid) ) {
71
72
std::unique_ptr<McEventCollection_p2> persObj(
poolReadObject<McEventCollection_p2>
(token) );
73
McEventCollectionCnv_p2
cnv;
74
transObj = cnv.
createTransient
( persObj.get(),
msg
);
75
}
else
if
(
compareClassGuid
(token, p3_guid) ) {
76
77
std::unique_ptr<McEventCollection_p3> persObj(
poolReadObject<McEventCollection_p3>
(token) );
78
McEventCollectionCnv_p3
cnv;
79
transObj = cnv.
createTransient
( persObj.get(),
msg
);
80
}
else
if
(
compareClassGuid
(token, p4_guid) ) {
81
82
std::unique_ptr<McEventCollection_p4> persObj(
poolReadObject<McEventCollection_p4>
(token) );
83
McEventCollectionCnv_p4
cnv;
84
if
(isPileup) cnv.
setPileup
();
85
transObj = cnv.
createTransient
( persObj.get(),
msg
);
86
}
else
if
(
compareClassGuid
(token, p5_guid) ) {
87
88
std::unique_ptr<McEventCollection_p5> persObj(
poolReadObject<McEventCollection_p5>
(token) );
89
McEventCollectionCnv_p5
cnv;
90
if
(isPileup) cnv.
setPileup
();
91
transObj = cnv.
createTransient
( persObj.get(),
msg
);
92
}
else
if
(
compareClassGuid
(token, p6_guid) ) {
93
94
std::unique_ptr<McEventCollection_p6> persObj(
poolReadObject<McEventCollection_p6>
(token) );
95
McEventCollectionCnv_p6
cnv;
96
if
(isPileup) cnv.
setPileup
();
97
transObj = cnv.
createTransient
( persObj.get(),
msg
);
98
}
else
if
(
compareClassGuid
(token, p7_guid) ) {
99
100
std::unique_ptr<McEventCollection_p7> persObj(
poolReadObject<McEventCollection_p7>
(token) );
101
McEventCollectionCnv_p7
cnv;
102
if
(isPileup) cnv.
setPileup
();
103
transObj = cnv.
createTransient
( persObj.get(),
msg
);
104
}
else
{
105
throw
std::runtime_error(
"Unsupported persistent version of McEventCollection"
);
106
}
107
108
return
transObj;
109
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
McEventCollectionCnv.h
McEventCollection_PERS
McEventCollection_p6 McEventCollection_PERS
Definition
McEventCollectionCnv.h:25
McEventCollectionCnv_p1.h
McEventCollectionCnv_p2.h
McEventCollectionCnv_p3.h
McEventCollectionCnv_p4.h
McEventCollectionCnv_p5.h
McEventCollectionCnv_p6.h
McEventCollectionCnv_p7.h
T_AthenaPoolCustomCnv< McEventCollection, McEventCollection_PERS >::msg
MsgStream & msg() const
Definition
AthMessaging.h:167
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition
Guid.h:25
McEventCollectionCnv_p1
Definition
McEventCollectionCnv_p1.h:34
McEventCollectionCnv_p2
Definition
McEventCollectionCnv_p2.h:38
McEventCollectionCnv_p3
Definition
McEventCollectionCnv_p3.h:37
McEventCollectionCnv_p4
Definition
McEventCollectionCnv_p4.h:40
McEventCollectionCnv_p4::setPileup
void setPileup()
Definition
McEventCollectionCnv_p4.cxx:437
McEventCollectionCnv_p5
Definition
McEventCollectionCnv_p5.h:41
McEventCollectionCnv_p5::setPileup
void setPileup()
Definition
McEventCollectionCnv_p5.cxx:523
McEventCollectionCnv_p6
Definition
McEventCollectionCnv_p6.h:41
McEventCollectionCnv_p6::setPileup
void setPileup()
Definition
McEventCollectionCnv_p6.cxx:593
McEventCollectionCnv_p7
Definition
McEventCollectionCnv_p7.h:41
McEventCollectionCnv_p7::setPileup
void setPileup()
Definition
McEventCollectionCnv_p7.cxx:595
McEventCollectionCnv::createPersistent
virtual McEventCollection_PERS * createPersistent(McEventCollection *transCont)
Build the persistent representation from the transient one.
Definition
McEventCollectionCnv.cxx:28
McEventCollectionCnv::createTransient
virtual McEventCollection * createTransient(const Token *token)
Build the transient representation from a persistent one.
Definition
McEventCollectionCnv.cxx:39
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
Definition
McEventCollection.h:31
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
T_AthenaPoolCustomCnv< McEventCollection, McEventCollection_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< McEventCollection, McEventCollection_PERS >::poolReadObject
P * poolReadObject(const Token *token)
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
Generated on
for ATLAS Offline Software by
1.17.0