ATLAS Offline Software
Loading...
Searching...
No Matches
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
23
24// GeneratorObjectsAthenaPool includes
26
29{
30 MsgStream msg( msgSvc(), "McEventCollectionCnv" );
31
33 McEventCollection_PERS *persObj = cnv.createPersistent( transCont, msg );
34
35 msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg;
36 return persObj;
37}
38
40{
41 MsgStream msg( msgSvc(), "McEventCollectionConverter" );
42
43 McEventCollection *transObj = 0;
44
45 static const pool::Guid tr_guid("6DE62B45-7C72-4539-92F2-3A8E739A4AC3");
46 static const pool::Guid p1_guid("BF93438C-D1D3-4F1C-8850-EB690AB7C416");
47 static const pool::Guid p2_guid("851BB1D2-1964-4B0A-B83A-6BD596CFB5E2");
48 static const pool::Guid p3_guid("6FC41599-64D6-4DB9-973E-9493166F6291");
49 static const pool::Guid p4_guid("C517102A-94DE-407C-B07F-09BD81F6172E");
50 static const pool::Guid p5_guid("D52391A4-F951-46BF-A0D5-E407698D2917");
51 static const pool::Guid p6_guid("6B78A751-B31A-4597-BFB6-DDCE62646CF9");
52 static const pool::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(tr_guid) ) {
61
62 // regular object from before the T/P separation
64
65 } else if ( compareClassGuid(p1_guid) ) {
66
67 std::unique_ptr<McEventCollection_p1> persObj( poolReadObject<McEventCollection_p1>() );
69 transObj = cnv.createTransient( persObj.get(), msg );
70 } else if ( compareClassGuid(p2_guid) ) {
71
72 std::unique_ptr<McEventCollection_p2> persObj( poolReadObject<McEventCollection_p2>() );
74 transObj = cnv.createTransient( persObj.get(), msg );
75 } else if ( compareClassGuid(p3_guid) ) {
76
77 std::unique_ptr<McEventCollection_p3> persObj( poolReadObject<McEventCollection_p3>() );
79 transObj = cnv.createTransient( persObj.get(), msg );
80 } else if ( compareClassGuid(p4_guid) ) {
81
82 std::unique_ptr<McEventCollection_p4> persObj( poolReadObject<McEventCollection_p4>() );
84 if(isPileup) cnv.setPileup();
85 transObj = cnv.createTransient( persObj.get(), msg );
86 } else if ( compareClassGuid(p5_guid) ) {
87
88 std::unique_ptr<McEventCollection_p5> persObj( poolReadObject<McEventCollection_p5>() );
90 if(isPileup) cnv.setPileup();
91 transObj = cnv.createTransient( persObj.get(), msg );
92 } else if ( compareClassGuid(p6_guid) ) {
93
94 std::unique_ptr<McEventCollection_p6> persObj( poolReadObject<McEventCollection_p6>() );
96 if(isPileup) cnv.setPileup();
97 transObj = cnv.createTransient( persObj.get(), msg );
98 } else if ( compareClassGuid(p7_guid) ) {
99
100 std::unique_ptr<McEventCollection_p7> persObj( poolReadObject<McEventCollection_p7>() );
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}
#define endmsg
McEventCollection_p6 McEventCollection_PERS
virtual McEventCollection_PERS * createPersistent(McEventCollection *transCont)
Build the persistent representation from the transient one.
virtual McEventCollection * createTransient()
Build the transient representation from a persistent one.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.