34 for(std::list<int>::iterator iter = uniqueIDs.begin(); iter != uniqueIDs.end(); ++iter)
36 if(*iter < 0)
continue;
38 int elementID = *iter % 100;
39 int detectorID = (*iter - elementID)/100;
48 const int hodoIDs[2][4] = {{32, 38, 40, 46}, {31, 37, 39, 45}};
51 for(
int i = 0; i < 4; ++i)
64 for(
int i = 0; i < 4; ++i)
75 const int hodoIDs[2][4] = {{32, 38, 40, 46}, {31, 37, 39, 45}};
77 double x_exp[4], y_exp[4];
78 for(
int i = 0; i < 4; ++i)
84 for(
int i = 0; i < 4; ++i)
86 tb += (p_geomSvc->
isInPlane(hodoIDs[0][i], 0., y_exp[i]) ? 1 : -1);
96 for(
int i = 0; i < 4; ++i)
108 if(
getTB() == 0)
return false;
117 std::cout <<
"For this road: " <<
ratio() << std::endl;
118 for(
int i = 0; i < 4; i++)
122 std::cout << std::endl;
129 << std::setprecision(3) << std::setw(10) << std::setiosflags(std::ios::right) << road.
px_mean
130 << std::setprecision(3) << std::setw(10) << std::setiosflags(std::ios::right) << road.
getpXWidth()
131 << std::setprecision(3) << std::setw(10) << std::setiosflags(std::ios::right) << road.
px_min
132 << std::setprecision(3) << std::setw(10) << std::setiosflags(std::ios::right) << road.
px_max
133 << std::setw(6) << std::setiosflags(std::ios::right) << abs(road.
groupID)
135 << std::setprecision(4) << std::setw(20) << std::setiosflags(std::ios::right) << road.
weight()
136 << std::setprecision(4) << std::setw(20) << std::setiosflags(std::ios::right) << road.
ratio()
139 << std::setprecision(5) << std::setw(20) << std::setiosflags(std::ios::right) << road.
rndf;
171 for(
int i = 0; i < nElements; i++)
215 pXs.insert(
pXs.end(), elem.
pXs.begin(), elem.
pXs.end());
226 for(
unsigned int i = 0; i <
pXs.size(); i++)
231 return sum/
pXs.size();
244 for(
unsigned int i = 0; i <
pXs.size(); i++)
249 return sqrt(sigma/
pXs.size());
257 for(
int i = 1; i < 4; i++)
272 if(LR*LR1 == 3)
return 1;
273 if(LR*LR1 == -3)
return -1;
280 for(
int i = 0; i < 4; i++)
292 if(TB == 4)
return 1;
293 if(TB == -4)
return -1;
302 for(
int i = 0; i < 4; ++i)
315 for(
int i = 0; i < 4; ++i)
328 std::list<TriggerRoad> roads_new;
329 std::vector<std::pair<int, int> > hodoHits[4];
330 for(
int i = 0; i < nHits; i++)
333 if(detectorName.find(
"H1T") != std::string::npos || detectorName.find(
"H1B") != std::string::npos)
335 hodoHits[0].push_back(std::make_pair(dIDs[i], eIDs[i]));
337 else if(detectorName.find(
"H2T") != std::string::npos || detectorName.find(
"H2B") != std::string::npos)
339 hodoHits[1].push_back(std::make_pair(dIDs[i], eIDs[i]));
341 else if(detectorName.find(
"H3T") != std::string::npos || detectorName.find(
"H3B") != std::string::npos)
343 hodoHits[2].push_back(std::make_pair(dIDs[i], eIDs[i]));
345 else if(detectorName.find(
"H4T") != std::string::npos || detectorName.find(
"H4B") != std::string::npos)
347 hodoHits[3].push_back(std::make_pair(dIDs[i], eIDs[i]));
351 for(std::vector<std::pair<int, int> >::iterator iter = hodoHits[0].begin(); iter != hodoHits[0].end(); ++iter)
353 for(std::vector<std::pair<int, int> >::iterator jter = hodoHits[1].begin(); jter != hodoHits[1].end(); ++jter)
355 for(std::vector<std::pair<int, int> >::iterator kter = hodoHits[2].begin(); kter != hodoHits[2].end(); ++kter)
357 for(std::vector<std::pair<int, int> >::iterator lter = hodoHits[3].begin(); lter != hodoHits[3].end(); ++lter)
360 road_new.
addElement(iter->first, iter->second);
361 road_new.
addElement(jter->first, jter->second);
362 road_new.
addElement(kter->first, kter->second);
363 road_new.
addElement(lter->first, lter->second);
366 if(!road_new.
isValid())
continue;
369 road_new.
pXs.push_back(pX);
392 roads_new.push_back(road_new);
393 roads_new.push_back(road_new.
reflectTB());
std::ostream & operator<<(std::ostream &os, const TriggerRoad &road)
ClassImp(TriggerRoad) TriggerRoad
User interface class about the geometry of detector planes.
double getPlanePosition(int detectorID) const
static GeomSvc * instance()
singlton instance
int getPlaneNElements(int detectorID) const
int getExpElementID(int detectorID, double pos_exp)
std::string getDetectorName(const int &detectorID) const
bool isInPlane(int detectorID, double x, double y)
See if a point is in a plane.
void getExpPositionFast(Double_t z, Double_t &x, Double_t &y, Int_t iNode=-1)
double getExpPositionY(double z) const
double getExpPositionX(double z) const
static std::list< TriggerRoad > makeRoadList(int nHits, int dIDs[], int eIDs[], double z, double mass, double pX, double weight)
std::vector< double > pXs
double getpXWidth() const
static bool byRndFrequency(const TriggerRoad &elem1, const TriggerRoad &elem2)
TriggerRoad & operator+=(const TriggerRoad &elem)
static bool byMass(const TriggerRoad &elem1, const TriggerRoad &elem2)
static bool byTargetDump(const TriggerRoad &elem1, const TriggerRoad &elem2)
bool operator==(const TriggerRoad &elem) const
std::vector< int > elementIDs
std::vector< int > detectorIDs
void addElement(int detectorID, int elementID)
static bool byWeight(const TriggerRoad &elem1, const TriggerRoad &elem2)
static bool byPt(const TriggerRoad &elem1, const TriggerRoad &elem2)