55double JetCnvE(
float px,
float py,
float pz,
float m){
56 return std::sqrt( px*px + py*py + pz*pz + m*m);
61 MsgStream&
msg )
const
63 if(
msg.level() == MSG::DEBUG )
msg << MSG::DEBUG <<
"JetCnv_p6 Loading Jet from persistent state... " <<
endmsg;
73 trans->set_origin (origin);
80 if (
trans->m_constituentsN > 10000 ) {
84 trans->m_constituentsN = 0;
93 trans->setCalPx( momentum[ 0 ] );
94 trans->setCalPy( momentum[ 1 ] );
95 trans->setCalPz( momentum[ 2 ] );
96 trans->setCalE ( momentum[ 3 ] );
98 trans->setRawPx( momentum[ 4 ] );
99 trans->setRawPy( momentum[ 5 ] );
100 trans->setRawPz( momentum[ 6 ] );
101 trans->setRawE ( momentum[ 7 ] );
103 trans->setCScalePx( momentum[ 8 ] );
104 trans->setCScalePy( momentum[ 9 ] );
105 trans->setCScalePz( momentum[ 10 ] );
106 trans->setCScaleE ( momentum[ 11 ] );
127 if (
trans->m_tagInfoStore !=
nullptr) {
128 trans->m_tagInfoStore->clear();
131 if (
trans->m_tagInfoStore !=
nullptr) {
132 delete trans->m_tagInfoStore;
135 vector<const JetTagInfoBase *> *ptags =
137 if (ptags !=
nullptr) {
138 vector<const JetTagInfoBase*> &
tags (*ptags);
139 for (
unsigned int i = 0; i <
tags.size(); i++) {
152 if (
trans->m_assocStore !=
nullptr) {
153 trans->m_assocStore->clear();
156 if (
trans->m_assocStore !=
nullptr) {
157 delete trans->m_assocStore;
159 trans->m_assocStore =
new vector<const JetAssociationBase*> ();
160 vector<const JetAssociationBase *> *pass =
163 if (pass !=
nullptr) {
164 vector<const JetAssociationBase *> &
ass (*pass);
165 vector<const JetAssociationBase *> &store (*
trans->m_assocStore);
166 for (
unsigned int i = 0; i <
ass.size(); i++) {
167 unsigned int index =
ass[i]->m_keyIndex;
168 if (
index >= store.size()) {
169 store.resize(
index+1,
nullptr);
179 trans->setFastjetPtr(
nullptr);
181 if(
msg.level() == MSG::DEBUG )
msg << MSG::DEBUG <<
"Loaded Jet from persistent state [OK]. Final e=" <<
trans->e()
193 MsgStream&
msg )
const
195 if(
msg.level() == MSG::DEBUG )
msg << MSG::DEBUG <<
"JetCnv_p6 writing Jet to persistent state... " <<
trans->jetAuthor() <<
" id="<<
trans->id() <<
endmsg;
241 if (
trans->m_tagInfoStore !=
nullptr) {
242 vector<const JetTagInfoBase*> goodTagInfo;
243 const vector<const JetTagInfoBase*> &tagInfo(*(
trans->m_tagInfoStore));
244 for (
unsigned int i = 0; i < tagInfo.size(); i++) {
245 if (tagInfo[i] !=
nullptr) {
246 goodTagInfo.push_back(tagInfo[i]);
256 if (
trans->m_assocStore !=
nullptr) {
257 vector<const JetAssociationBase*> goodAssInfo;
258 const vector<const JetAssociationBase*> &assInfo(*
trans->m_assocStore);
260 for (
unsigned int i = 0; i < assInfo.size(); i++) {
261 if( (assInfo[i] !=
nullptr) &&
263 goodAssInfo.push_back(assInfo[i]);
270 if(
msg.level() == MSG::DEBUG ){
271 msg << MSG::DEBUG <<
"Created persistent state of Jet [OK]" <<
endmsg;
NavigableCnv_p1< Navigable< INavigable4MomentumCollection, double > > NavigableCnv_t
This file contains the class definition for the DataLinkCnv_p2 class and DataLinkVectorCnv_p2 class.
This file contains the class definition for the ElementLinkCnv_p3 class.
static const NavigableCnv_t navCnv
double JetCnvE(float px, float py, float pz, float m)
This file contains the class definition for the NavigableCnv_p2 class.
static const VxLinkCnv_t vxCnv
ElementLinkCnv_p1< ElementLink< VxContainer > > VxLinkCnv_t
ElementLink implementation for ROOT usage.
static const bool s_write0constit
Write Jet constituents.
TagAssCollectionCnv m_tagAssCnv
virtual void transToPers(const Jet *transObj, Jet_p6 *persObj, MsgStream &msg) const override
Method creating the persistent representation Jet_p6 from its transient representation Jet.
TagInfoCollectionCnv m_taginfoCnv
virtual void persToTrans(const Jet_p6 *persObj, Jet *transObj, MsgStream &msg) const override
Method creating the transient representation of Jet from its persistent representation Jet_p6.
A JetAssociation object for a generic object.
float m_momentum[12]
the 4-mom part
Navigable_p2< uint32_t, float > m_nav
the navigable part
int m_constituentSigState
we store the recoStatus for jets here
std::vector< TPObjRef > m_associations
JetAssociationBase objects.
ElementLinkInt_p3 m_origin
link to the particle's origin (vertex)
unsigned int m_author
storing what jet algorithm the jet belongs to
std::vector< TPObjRef > m_tagJetInfo
JetTagInfoBase objects.
unsigned int m_constituentsN
make the histogram assessment part of the config
TH1F * trans(TH1F *h, bool t=false)
std::vector< std::string > tags