42 MsgStream&
msg )
const
44 if(
msg.level() == MSG::DEBUG )
msg << MSG::DEBUG <<
"Loading Jet from persistent state... " <<
endmsg;
58 trans->m_RoIword = 0xFFFFFFFF;
63 if (
trans->m_constituentsN > 10000 ) {
67 trans->m_constituentsN = 0;
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
96 <<
" sig state = "<<
trans->signalState() <<
endmsg;
111 e=sqrt(px*px+py*py+pz*pz+m*m);
122 trans->set4Mom(vec4);
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;
149 trans->setCScaleE( vec4.e());
150 trans->setCScalePx(vec4.px());
151 trans->setCScalePy(vec4.py());
152 trans->setCScalePz(vec4.pz());
157 <<
" new constscale_e ="<<
trans->getCScaleE() <<
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.);
178 trans->setMoment(
"Timing", jetTime);
179 trans->setMoment(
"LArQuality", jetQuality);
181 const_cast<Jet_p5*
>(pers)->m_shapeStore.clear();
190 if (
trans->m_tagInfoStore !=
nullptr) {
191 trans->m_tagInfoStore->clear();
194 if (
trans->m_tagInfoStore !=
nullptr) {
195 delete trans->m_tagInfoStore;
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++) {
215 if (
trans->m_assocStore !=
nullptr) {
216 trans->m_assocStore->clear();
219 if (
trans->m_assocStore !=
nullptr) {
220 delete trans->m_assocStore;
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()
253 MsgStream&
msg )
const
277 if(
msg.level() == MSG::DEBUG ) {
279 msg << MSG::DEBUG <<
"Writing jets " <<
trans->jetAuthor() <<
" trans_e = "<<
trans->e()
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();
321 if (
trans->m_tagInfoStore !=
nullptr) {
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]);
336 if (
trans->m_assocStore !=
nullptr) {
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
This file contains the class definition for the NavigableCnv_p1 class.
static const bool s_write0constit
Write Jet constituents.
TagAssCollectionCnv m_tagAssCnv
virtual void transToPers(const Jet *transObj, Jet_p5 *persObj, MsgStream &msg) const override
Method creating the persistent representation Jet_p5 from its transient representation Jet.
TagInfoCollectionCnv m_taginfoCnv
virtual void persToTrans(const Jet_p5 *persObj, Jet *transObj, MsgStream &msg) const override
Method creating the transient representation of Jet from its persistent representation Jet_p5.
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()
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
CLHEP::HepLorentzVector hlv_t
JetConverterTypes::momentum decompress(const JetConverterTypes::signalState_pers_t &ps, JetConverterTypes::momentum momCal, MsgStream &msg) const
make the histogram assessment part of the config
TH1F * trans(TH1F *h, bool t=false)
std::vector< std::string > tags
static const key_t ShapeCat
Index category for jet shapes.