ATLAS Offline Software
TauDetailsContainerCnv_p1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // @file TauDetailsContainerCnv_p1.cxx
18 
21 #include "tauEvent/TauRecDetails.h"
25 
28  Analysis::TauDetailsContainer,
30 {
31 }
32 
34 {
35 }
36 
38  const Analysis::TauDetailsContainer *transVect,
39  TauDetailsContainer_p1 *persVect,
40  MsgStream &msg )
41 {
43  persVect->clear();
44  persVect->reserve( transVect->size() );
46  it != transVect->end(); ++it ) {
47  if (dynamic_cast<const Analysis::TauRecDetails *>(*it)!=0) continue;
48  if (dynamic_cast<const Analysis::TauRecExtraDetails*>(*it)!=0) continue;
49  if (dynamic_cast<const Analysis::Tau1P3PDetails*>(*it)!=0) continue;
50  if (dynamic_cast<const Analysis::Tau1P3PExtraDetails*>(*it)!=0) continue;
51  persVect->push_back(
53  &cnv, *it, msg ) );
54  }
55 }
56 
58  const TauDetailsContainer_p1 *persVect,
60  MsgStream &msg )
61 {
63  transVect->clear();
64  transVect->reserve( persVect->size() );
65  for( TauDetailsContainer_p1 :: const_iterator it = persVect->begin();
66  it != persVect->end(); ++it )
67  {
68  // Bleh --- the list of converters was reordered at one point,
69  // a Thing One Should Never Do.
70  // Try to hack around this.
71  TPObjRef ref = *it;
72  ITPConverter* cnvtest = nullptr;
73  cnvtest = converterForRef (cnvtest, ref, msg);
74  if (dynamic_cast<TauShotCnv_p1*>(cnvtest)) {
75  unsigned short tlid = ref.topLevelCnvID();
76  unsigned short cnvid = (ref.typeID() & 0xffff);
77  ref = TPObjRef (TPObjRef::typeID_t(tlid, cnvid+1), ref.index());
78  }
79 
80  transVect->push_back(
82  &cnv, ref, msg ) );
83  }
84 }
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
ITPConverterFor
Definition: TPConverter.h:37
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
TauRecExtraDetails.h
Analysis::TauDetailsContainer
Definition: TauDetailsContainer.h:31
TauShotCnv_p1.h
Analysis::TauRecDetails
DEPRECATED DO NOT USE - MIGRATE TO TauCommonDetails Basic details class containing information produc...
Definition: TauRecDetails.h:36
TauDetailsContainer_p1
Definition: TauDetailsContainer_p1.h:19
TauDetailsContainerCnv_p1::TauDetailsContainerCnv_p1
TauDetailsContainerCnv_p1()
Constructor.
Definition: TauDetailsContainerCnv_p1.cxx:26
TauShotCnv_p1
Transient Persistent converter version 1 for TauShot.
Definition: TauShotCnv_p1.h:31
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TPConverterBase
Definition: TPConverter.h:738
Tau1P3PExtraDetails.h
TPObjRef
Definition: TPObjRef.h:20
Analysis::TauRecExtraDetails
DEPRECATED DO NOT USE - MIGRATE TO TauCommonDetails Extended details class containing information pro...
Definition: TauRecExtraDetails.h:35
Tau1P3PDetails.h
TauDetailsContainerCnv_p1::transToPers
virtual void transToPers(const Analysis::TauDetailsContainer *transVect, TauDetailsContainer_p1 *persVect, MsgStream &msg)
Creates persistent object from transient object.
Definition: TauDetailsContainerCnv_p1.cxx:37
TauDetailsContainerCnv_p1::~TauDetailsContainerCnv_p1
virtual ~TauDetailsContainerCnv_p1()
Destructor.
Definition: TauDetailsContainerCnv_p1.cxx:33
TauDetailsContainerCnv_p1.h
DataVector::clear
void clear()
Erase all the elements in the collection.
ITPConverterFor::converterForRef
CNV * converterForRef(CNV *cnv, const TPObjRef &ref, MsgStream &log) const
Find converter for a TP type ID (passed in a TP Ref), that is or ihnerits from CNV type.
Definition: TPConverter.h:74
ITPConverterFor::toPersistent
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Persistify an object and store the persistent represenation in the storage vector of the top-level pe...
Definition: TPConverter.h:119
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
TauRecDetails.h
Analysis::Tau1P3PDetails
DEPRECATED DO NOT USE - MIGRATE TO TauCommonDetails Basic details class containing information produc...
Definition: Tau1P3PDetails.h:41
ref
const boost::regex ref(r_ef)
Analysis::Tau1P3PExtraDetails
DEPRECATED DO NOT USE - MIGRATE TO TauCommonDetails Extended details class containing information pro...
Definition: Tau1P3PExtraDetails.h:36
TauDetailsContainerCnv_p1::persToTrans
virtual void persToTrans(const TauDetailsContainer_p1 *persVect, Analysis::TauDetailsContainer *transVect, MsgStream &msg)
Creates transient object from persistent object.
Definition: TauDetailsContainerCnv_p1.cxx:57
TPObjRef::typeID_t
Definition: TPObjRef.h:31
ITPConverter
Definition: TPTools/TPTools/ITPConverter.h:32
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
ITPConverterFor::createTransFromPStore
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
Create transient representation of a persistent object, stored in the the top-level persistent object...
Definition: TPConverter.h:172