40void JetCnv_p5::persToTrans(
const Jet_p5* pers,
42 MsgStream&
msg )
const
44 if(
msg.level() == MSG::DEBUG )
msg << MSG::DEBUG <<
"Loading Jet from persistent state... " <<
endmsg;
72#if __FLT_EVAL_METHOD__ == 2
84 if(m<0) e = std::sqrt(px*px+py*py+pz*pz-m*m);
85 else e = std::sqrt(px*px+py*py+pz*pz+m*m);
92 if(
msg.level() == MSG::DEBUG ) {
94 msg << MSG::DEBUG <<
"Reading jets " << trans->
jetAuthor() <<
" pers_e = "<<e
111 e=sqrt(px*px+py*py+pz*pz+m*m);
126 if(
msg.level() == MSG::DEBUG ) {
127 msg << MSG::DEBUG <<
" --> signal state saved : ";
129 msg << MSG::DEBUG <<
" raw_e =" << trans->
getRawE() <<
" constscale_e=" << trans->
getCScaleE() <<
" final_e="<<trans->
e() <<
endmsg;
130 }
else msg << MSG::DEBUG<<
" None " <<
endmsg;
163 if( !(pers)->m_shapeStore.empty() ){
164 if( momentNames.size() < (pers)->m_shapeStore.size() ) {
if( ! pers->
m_usedForTrigger ) {
165 msg << MSG::WARNING <<
" JetCnv_p5 can't convert moments ! num max keys = "<< momentNames.size() <<
" persistant jet has n= "<< (pers)->m_shapeStore.size() <<
endmsg; }
168 for(
size_t i=0;i<(pers)->m_shapeStore.size();i++){
169 trans->
setMoment(momentNames[i], (pers)->m_shapeStore[i],
true);
175 double jetQuality = ((pers->
m_recoStatus & 65535) >> 3)*(1./8191.);
179 trans->
setMoment(
"LArQuality", jetQuality);
181 const_cast<Jet_p5*
>(pers)->m_shapeStore.clear();
198 vector<const JetTagInfoBase *> *ptags =
200 if (ptags !=
nullptr) {
201 vector<const JetTagInfoBase*> &
tags (*ptags);
202 for (
unsigned int i = 0; i <
tags.size(); i++) {
222 trans->
m_assocStore =
new vector<const JetAssociationBase*> ();
223 vector<const JetAssociationBase *> *pass =
226 if (pass !=
nullptr) {
227 vector<const JetAssociationBase *> &
ass (*pass);
228 vector<const JetAssociationBase *> &store (*trans->
m_assocStore);
229 for (
unsigned int i = 0; i <
ass.size(); i++) {
230 unsigned int index =
ass[i]->m_keyIndex;
231 if (
index >= store.size()) {
232 store.resize(
index+1,
nullptr);
241 if(
msg.level() == MSG::DEBUG )
msg << MSG::DEBUG <<
"Loaded Jet from persistent state [OK]. Final e=" << trans->
e()
251void JetCnv_p5::transToPers(
const Jet* trans,
253 MsgStream&
msg )
const
261 if( ! s_write0constit) {
272 pers->
m_momentum = JetConverterTypes::momentum( trans->
px(),
277 if(
msg.level() == MSG::DEBUG ) {
279 msg << MSG::DEBUG <<
"Writing jets " << trans->
jetAuthor() <<
" trans_e = "<< trans->
e()
280 <<
" skipping constituent : "<< s_write0constit <<
endmsg;
301 const std::vector<JetMoment::MomentData> *rec = map->
getRecord(trans->
m_jetId);
304 (pers)->m_shapeStore.resize(
keys.size());
305 for(
size_t i=0;
i< rec->size();++
i){
306 (pers)->m_shapeStore[i] = rec->operator[](i).moment();
322 vector<const JetTagInfoBase*> goodTagInfo;
323 const vector<const JetTagInfoBase*> &tagInfo(*(trans->
m_tagInfoStore));
324 for (
unsigned int i = 0;
i < tagInfo.size();
i++) {
325 if (tagInfo[i] !=
nullptr) {
326 goodTagInfo.push_back(tagInfo[i]);
337 vector<const JetAssociationBase*> goodAssInfo;
338 const vector<const JetAssociationBase*> &assInfo(*trans->
m_assocStore);
340 for (
unsigned int i = 0;
i < assInfo.size();
i++) {
341 if (assInfo[i] !=
nullptr) {
342 goodAssInfo.push_back(assInfo[i]);
349 if(
msg.level() == MSG::DEBUG ){
350 msg << MSG::DEBUG <<
"Created persistent state of Jet [OK]" <<
endmsg;
NavigableCnv_p1< Navigable< INavigable4MomentumCollection, double > > NavigableCnv_t
static const NavigableCnv_t navCnv
static const ParticleBaseCnv_p1 pbsCnv
Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current JetMomentMap
This file contains the class definition for the NavigableCnv_p1 class.
Theses classes implement a mapping between string and index used by jets.
const std::vector< key_t > & getKeys(const category_t &cat) const
static JetKeyDescriptorInstance * instance()
virtual const record_t * getRecord(size_t jetIndex) const
get the full record for a given jet
JetConverterTypes::signalState_pers_t m_rawSignal
std::vector< TPObjRef > m_associations
JetAssociationBase objects.
std::vector< TPObjRef > m_tagJetInfo
JetTagInfoBase objects.
unsigned int m_constituentsN
JetConverterTypes::momentum m_momentum
the 4-mom part
ParticleBase_p1 m_partBase
The Particle base stuff – since Jet now inherits from particle base.
unsigned int m_author
storing what jet algorithm the jet belongs to
unsigned int m_recoStatus
we store the recoStatus for jets here
Navigable_p1< uint32_t, double > m_nav
the navigable part
virtual void setE(double e)
Kinematics are now handled by the base class, except for the following.
signalstate_t constituentSignalState() const
Get the current Signal state of the jet constituents.
const shape_map_t * getMomentMap(bool addIfMissing) const
virtual void setPx(double Px)
size_t m_jetId
the identifier of this jet within its collection.
CLHEP::HepLorentzVector hlv_t
virtual void setPz(double pz)
void addInfo(const TAGINFO *tag)
Add tag info object.
tagstore_t * m_tagInfoStore
Tag info store.
std::string jetAuthor() const
Author and calibration history are encoded in a simple way inside the jet object.
size_t m_jetAuthor
Jet author store.
assostore_t * m_assocStore
key descriptor for all jet stores
double getCScaleE() const
hlv_t constituent_sum4Mom() const
Sum of weighted constituent four-momentums.
void setCScaleE(double e)
Sets uncalibrated .
void setCScalePy(double py)
Sets uncalibrated .
void setMoment(const mkey_t &shapeName, shape_t shape, bool addIfMissing=true) const
Alias for setShape.
void setRawPx(double px)
Sets uncalibrated .
void setCScalePx(double px)
Sets uncalibrated .
void setRawE(double e)
Sets uncalibrated .
void setRawPy(double py)
Sets uncalibrated .
numconstit_t m_constituentsN
void setCScalePz(double pz)
Sets uncalibrated .
void setRawPz(double pz)
Sets uncalibrated .
virtual void setPy(double py)
signalstate_t m_constituentSigState
Constituent Signal State.
void transToPers(const Navigable_t &trans, PersNavigable_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
virtual void transToPers(const ParticleBase *transObj, ParticleBase_p1 *persObj, MsgStream &msg) const final
Method creating the persistent representation ParticleBase_p1 from its transient representation Parti...
virtual bool setSignalState(state_t s)
set the current signal state
virtual double m() const
mass
const particle_type & particleBase() const
access to underlying base type (IParticle-like)
virtual state_t signalState() const
Retrieve current signal state.
virtual double pz() const
z component of momentum
virtual double e() const
energy
virtual double py() const
y component of momentum
virtual CLHEP::HepLorentzVector hlv() const
CLHEP HepLorentzVector.
const navigable_type & navigableBase() const
access to underlying base type (INavigable-like)
virtual void set4Mom(const I4Momentum &p4)
set 4Momentum (will throw exception if cannot be implemented)
virtual double px() const
We re-define here extra class routines that will allow direct access to signal state kinematics witho...
JetConverterTypes::momentum decompress(const JetConverterTypes::signalState_pers_t &ps, JetConverterTypes::momentum momCal, MsgStream &msg) const
make the histogram assessment part of the config
std::vector< std::string > tags
static const key_t ShapeCat
Index category for jet shapes.