Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/LCTuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "JetBranches.h"
#include "TrackBranches.h"
#include "PIDBranches.h"
#include "RecoParticleBranches.h"


using namespace lcio ;
Expand Down Expand Up @@ -129,7 +130,7 @@ class LCTuple : public Processor {
CWBranchesSet* _evtBranches {};
CollectionBranches* _mcpBranches {};
CollectionBranches* _mcpremoveoverlayBranches {};
CollectionBranches* _recBranches {};
RecoParticleBranches* _recBranches {};
// CollectionBranches* _jetBranches {};
JetBranches* _jetBranches {};
CollectionBranches* _isolepBranches {};
Expand Down
3 changes: 2 additions & 1 deletion include/RecoParticleBranches.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class RecoParticleBranches : public CollectionBranches {

virtual void initBranches( TTree* tree, const std::string& prefix="" ) ; //const char* prefix=0) ;

virtual void fill(const EVENT::LCCollection* col, EVENT::LCEvent* evt ) ;
virtual void fill(const EVENT::LCCollection* col, EVENT::LCEvent* evt, const EVENT::LCCollection* colCluster ) ;

virtual ~RecoParticleBranches() {} ;

Expand Down Expand Up @@ -71,6 +71,7 @@ class RecoParticleBranches : public CollectionBranches {
// EVENT::ClusterVec _clusters ;
// EVENT::TrackVec _tracks ;

int _rcclid[ LCT_RECOPARTICLE_MAX ][10] {} ;

} ;

Expand Down
2 changes: 1 addition & 1 deletion src/LCTuple.cc
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ void LCTuple::processEvent( LCEvent * evt ) {
if( mcpRemoveOverlayCol ) _mcpremoveoverlayBranches->fill( mcpRemoveOverlayCol , evt ) ;

if( recCol ) {
_recBranches->fill( recCol , evt ) ;
_recBranches->fill( recCol , evt , cluCol ) ;

for( auto pidb : _pidBranchesVec ) pidb->fill( recCol , evt ) ;
}
Expand Down
33 changes: 31 additions & 2 deletions src/RecoParticleBranches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "EVENT/Vertex.h"

#include "TTree.h"
#include <algorithm>


void RecoParticleBranches::initBranches( TTree* tree, const std::string& pre){
Expand Down Expand Up @@ -54,10 +55,12 @@ void RecoParticleBranches::initBranches( TTree* tree, const std::string& pre){
tree->Branch( (pre+"pillh").c_str() , _pillh , (pre+"pillh["+pre+"npid]/F").c_str() ) ;
tree->Branch( (pre+"pialg").c_str() , _pialg , (pre+"pialg["+pre+"npid]/I").c_str() ) ;

//tree->Branch( (pre+"rcclid").c_str() , _rcclid , (pre+"rcclid["+pre+"nrec]["+pre+"rcncl]/I").c_str() ) ;
tree->Branch( (pre+"rcclid").c_str() , _rcclid , (pre+"rcclid["+pre+"nrec][10]/I").c_str() ) ;
}


void RecoParticleBranches::fill(const EVENT::LCCollection* col, EVENT::LCEvent* evt ){
void RecoParticleBranches::fill(const EVENT::LCCollection* col, EVENT::LCEvent* evt, const EVENT::LCCollection* colCluster){

if( !col ) return ;

Expand Down Expand Up @@ -104,7 +107,7 @@ void RecoParticleBranches::fill(const EVENT::LCCollection* col, EVENT::LCEvent*
_pialg[ i ] = pid->getAlgorithmType() ;
}


std::vector<int> usedClusters;

//------ fill the Reconstructed particle ----------------------------
for(int i=0 ; i < _nrec ; ++i){
Expand Down Expand Up @@ -146,7 +149,33 @@ void RecoParticleBranches::fill(const EVENT::LCCollection* col, EVENT::LCEvent*
_rcnrp[ i ] = rec->getParticles().size();

_rcftr[ i ] = ( rec->getTracks().size() > 0 ? rec->getTracks()[0]->ext<CollIndex>() - 1 : -1 ) ;

for(int s = 0; s < 10; s++){
_rcclid[i][s] = -1;
}

if(!colCluster) continue;
lcio::ClusterVec clusters = rec->getClusters();
lcio::Cluster* temp_clus = NULL;

for(unsigned int c = 0; c < clusters.size(); c++){

for(int ccoll = 0; ccoll < colCluster->getNumberOfElements(); ccoll++){

if(std::find(usedClusters.begin(), usedClusters.end(), ccoll) != usedClusters.end() )
continue;

temp_clus = static_cast<lcio::Cluster*>( colCluster->getElementAt(ccoll) );

if(temp_clus->id() != clusters[c]->id()) continue;

_rcclid[i][c] = ccoll;
usedClusters.push_back(ccoll);
break;
}
}

usedClusters.clear();
}

}