Skip to content

Commit

Permalink
Fix FTBasedPid so clas12reader::getByID is based on FT based Pid if c…
Browse files Browse the repository at this point in the history
…12.useFTBased(); is called
  • Loading branch information
dglazier committed Aug 30, 2019
1 parent 331ccdc commit ea40900
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 1 addition & 7 deletions Clas12Banks/clas12reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,7 @@ namespace clas12 {
continue;
}
}
// //If additional particle sources, add those particles to detParticles
// if(_additionalParticleSource.size()){
// for(auto &psource : _additionalParticleSource)
// while(auto& particle=psource.nextParticle()){
// _detParticles.push_back(particle);
// }
// }


}
bool clas12reader::passPidSelect(){
Expand Down
5 changes: 4 additions & 1 deletion Clas12Banks/clas12reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,19 @@ namespace clas12 {
//Forward detector needs particles, calorimeter, scintillator,
//track, cherenkov
_rfdets.push_back(std::make_shared<region_fdet>(_bparts,_bftbparts,_bcovmat,_bcal,_bscint,_btrck,_btraj,_bcher,_bft,_bevent));
if(_useFTBased)_rfdets.back()->useFTBPid();
}
void addARegionCDet(){
//Forward detector needs particles, calorimeter, scintillator,
//track, cherenkov
_rcdets.push_back(std::make_shared<region_cdet>(_bparts,_bftbparts,_bcovmat,_bcal,_bscint,_btrck,_btraj,_bcher,_bft,_bevent));
if(_useFTBased)_rcdets.back()->useFTBPid();
}
void addARegionFT(){
//Forward tagger needs particles and forward tagger
_rfts.push_back(std::make_shared<region_ft>(_bparts,_bftbparts,_bcovmat,_bcal,_bscint,_btrck,_btraj,_bcher,_bft,_bevent));
}
if(_useFTBased)_rfts.back()->useFTBPid();
}


const helonline_ptr helonline() const{return _bhelonline;};
Expand Down
8 changes: 6 additions & 2 deletions Clas12Banks/region_particle.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ namespace clas12 {
return true;
}

int getPid(){_parts->setEntry(_pentry);return _parts->getPid();}
int getPid(){_parts->setEntry(_pentry);
return _useFTBPid*_ftbparts->getRows()?_ftbparts->getPid():_parts->getPid();
}

virtual double getTime()=0;
virtual double getPath()=0;
Expand Down Expand Up @@ -90,6 +92,8 @@ namespace clas12 {
float getCalcMass();
float getBeta();
float getGamma();

void useFTBPid(){if(_ftbparts.get())_useFTBPid=1;}

protected:

Expand All @@ -109,7 +113,7 @@ namespace clas12 {
short _pentry=-1;
short _pcmat=-1;
short _region=-1;

short _useFTBPid=0;
};
//pointer "typedef"
using region_part_ptr=std::shared_ptr<clas12::region_particle>;
Expand Down

0 comments on commit ea40900

Please sign in to comment.