Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ILDCellID0 with LCTrackerCellID #9

Merged
merged 1 commit into from
Mar 31, 2017
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
22 changes: 11 additions & 11 deletions Tracking/src/ClicEfficiencyCalculator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <IMPL/TrackImpl.h>

#include <UTIL/CellIDEncoder.h>
#include <UTIL/ILDConf.h>
#include <UTIL/LCTrackerConf.h>
#include <UTIL/BitSet32.h>
#include <UTIL/LCRelationNavigator.h>

Expand Down Expand Up @@ -273,7 +273,7 @@ void ClicEfficiencyCalculator::processEvent( LCEvent* evt ) {
// First pick up all of the collections that will be used - tracks, MCparticles, hits from relevent subdetectors - and their relations

// Initialise CELLID encoder to get the subdetector ID from a hit
UTIL::BitField64 m_encoder( lcio::ILDCellID0::encoder_string ) ;
UTIL::BitField64 m_encoder( lcio::LCTrackerCellID::encoding_string() ) ;
std::vector<int> m_collections;

// Get the collection of tracks
Expand Down Expand Up @@ -651,22 +651,22 @@ int ClicEfficiencyCalculator::getSubdetector(LCCollection* collection, UTIL::Bit
TrackerHitPlane* hit = dynamic_cast<TrackerHitPlane*>( collection->getElementAt(0) ) ;
const int celId = hit->getCellID0() ;
encoder.setValue(celId) ;
int subdet = encoder[lcio::ILDCellID0::subdet];
int subdet = encoder[lcio::LCTrackerCellID::subdet()];
return subdet;
}


int ClicEfficiencyCalculator::getSubdetector(TrackerHit* hit, UTIL::BitField64 &encoder){
const int celId = hit->getCellID0() ;
encoder.setValue(celId) ;
int subdet = encoder[lcio::ILDCellID0::subdet];
int subdet = encoder[lcio::LCTrackerCellID::subdet()];
return subdet;
}

int ClicEfficiencyCalculator::getLayer(TrackerHit* hit, UTIL::BitField64 &encoder){
const int celId = hit->getCellID0() ;
encoder.setValue(celId) ;
int layer = encoder[lcio::ILDCellID0::layer];
int layer = encoder[lcio::LCTrackerCellID::layer()];
return layer;
}

Expand All @@ -687,7 +687,7 @@ bool ClicEfficiencyCalculator::isReconstructable(MCParticle*& particle, std::str
// Only make tracks with 4 or more hits in the vertex detector
std::vector<TrackerHit*> trackHits = particleHits[particle];
int nVXDHits = 0;
UTIL::BitField64 encoder( lcio::ILDCellID0::encoder_string ) ;
UTIL::BitField64 encoder( lcio::LCTrackerCellID::encoding_string() ) ;
for (size_t ihit=0; ihit<trackHits.size(); ihit++){
int subdetector = getSubdetector(trackHits.at(ihit), encoder);
if (subdetector==1 || subdetector==2) nVXDHits++;
Expand Down Expand Up @@ -734,7 +734,7 @@ bool ClicEfficiencyCalculator::isReconstructable(MCParticle*& particle, std::str
//if(trackHits.size() >= 6) passNHits = true;

// int nVXDHits = 0;
// UTIL::BitField64 encoder( lcio::ILDCellID0::encoder_string ) ;
// UTIL::BitField64 encoder( lcio::LCTrackerCellID::encoding_string() ) ;
// for (size_t ihit=0; ihit<trackHits.size(); ihit++){
// int subdetector = getSubdetector(trackHits.at(ihit), encoder);
// if (subdetector == m_vertexBarrelID) nVXDHits++;
Expand Down Expand Up @@ -784,7 +784,7 @@ bool ClicEfficiencyCalculator::isReconstructable(MCParticle*& particle, std::str
if(trackHits.size() >= 4) passNHits = true;

int nVXDHits = 0;
UTIL::BitField64 encoder( lcio::ILDCellID0::encoder_string ) ;
UTIL::BitField64 encoder( lcio::LCTrackerCellID::encoding_string() ) ;
std::vector<int > vec_hit_subdet;
std::vector<int > vec_hit_layer;
for (size_t ihit=0; ihit<trackHits.size(); ihit++){
Expand Down Expand Up @@ -848,9 +848,9 @@ int ClicEfficiencyCalculator::getUniqueHits(std::vector<TrackerHit*> trackHits,

// Get the subdetector information
encoder.setValue(celId) ;
int subdet = encoder[lcio::ILDCellID0::subdet];
int side = encoder[lcio::ILDCellID0::side];
int layer = encoder[lcio::ILDCellID0::layer];
int subdet = encoder[lcio::LCTrackerCellID::subdet()];
int side = encoder[lcio::LCTrackerCellID::side()];
int layer = encoder[lcio::LCTrackerCellID::layer()];

// Make a unique id
int id = ((subdet & 0xFF) << 16) + ((side & 0xFF) << 8) + (layer & 0xFF);
Expand Down
10 changes: 5 additions & 5 deletions Tracking/src/HitResiduals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "MarlinTrk/IMarlinTrack.h"

#include <UTIL/BitField64.h>
#include <UTIL/ILDConf.h>
#include <UTIL/LCTrackerConf.h>

#include "DD4hep/LCDD.h"
#include "DD4hep/DD4hepUnits.h"
Expand Down Expand Up @@ -192,8 +192,8 @@ void HitResiduals::processEvent( LCEvent * evt ) {



UTIL::BitField64 cellid_decoder( lcio::ILDCellID0::encoder_string ) ;
UTIL::BitField64 encoder( lcio::ILDCellID0::encoder_string ) ;
UTIL::BitField64 cellid_decoder( lcio::LCTrackerCellID::encoding_string() ) ;
UTIL::BitField64 encoder( lcio::LCTrackerCellID::encoding_string() ) ;
encoder.reset() ; // reset to 0
int layerID = encoder.lowWord() ;
int elementID = 0 ;
Expand Down Expand Up @@ -233,8 +233,8 @@ void HitResiduals::processEvent( LCEvent * evt ) {
streamlog_out(DEBUG1) << "layer = " << layer << std::endl;
streamlog_out(DEBUG1) << "subdet = " << subdet << std::endl;

encoder[lcio::ILDCellID0::subdet] = subdet;
encoder[lcio::ILDCellID0::layer] = layer;
encoder[lcio::LCTrackerCellID::subdet()] = subdet;
encoder[lcio::LCTrackerCellID::layer()] = layer;
layerID = encoder.lowWord();
streamlog_out(DEBUG1) << "layerID = " << layerID << std::endl;

Expand Down
2 changes: 1 addition & 1 deletion Tracking/src/TrackChecker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <IMPL/TrackImpl.h>

#include <UTIL/CellIDEncoder.h>
#include <UTIL/ILDConf.h>
#include <UTIL/LCTrackerConf.h>
#include <UTIL/BitSet32.h>
#include <UTIL/LCRelationNavigator.h>

Expand Down