10 std::vector<susybsm::RPCHit4D> HSCPRPCRecHits = uHSCPRPCRecHits;
12 bool outOfTime =
false;
13 bool increasing =
true;
14 bool anydifferentzero =
true;
15 bool anydifferentone =
true;
19 std::sort(HSCPRPCRecHits.begin(), HSCPRPCRecHits.end());
21 for (std::vector<susybsm::RPCHit4D>::iterator
point = HSCPRPCRecHits.begin();
point < HSCPRPCRecHits.end(); ++
point) {
22 outOfTime |= (
point->bx != 0);
23 increasing &= (
point->bx >= lastbx);
24 anydifferentzero &= (!(
point->bx == 0));
25 anydifferentone &= (!(
point->bx == 1));
31 bool Candidate = (outOfTime && increasing);
41 float maginfirstknee = 0;
42 for (std::vector<susybsm::RPCHit4D>::iterator
point = HSCPRPCRecHits.begin();
point < HSCPRPCRecHits.end(); ++
point) {
44 maginfirstknee =
point->gp.mag();
45 }
else if ((lastbx !=
point->bx)) {
47 maginknee =
point->gp.mag();
55 betavalue = maginfirstknee / (25. -
delay + maginfirstknee / 30.) / 30.;
56 }
else if (knees == 1) {
61 if (!anydifferentzero) {
63 }
else if (!anydifferentone) {
66 betavalue1 = maginknee / (25 -
delay + maginknee / 30.) / 30.;
67 float dr = (maginknee - maginfirstknee);
68 betavalue2 =
dr / (25. -
delay +
dr / 30.);
70 betavalue = (betavalue1 + betavalue2) * 0.5;
72 }
else if (knees == 2) {
79 for (std::vector<susybsm::RPCHit4D>::iterator
point = HSCPRPCRecHits.begin();
point < HSCPRPCRecHits.end();
82 maginfirstknee =
point->gp.mag();
83 }
else if ((lastbx !=
point->bx)) {
87 float maginsecondknee =
point->gp.mag();
88 betavalue1 = maginknee / (25 -
delay + maginknee / 30.) / 30.;
89 float dr = (maginknee - maginsecondknee);
90 betavalue2 =
dr / (25. +
dr / 30.);
96 betavalue = (betavalue1 + betavalue2) * 0.5;
106 if (HSCPRPCRecHits.empty()) {