25 for ( TrackingGeometry::DetContainer::const_iterator iDet = rpcGeom->
dets().begin(); iDet < rpcGeom->
dets().end(); iDet++ ) {
28 if (dynamic_cast<const RPCChamber*>( *iDet ) ==
nullptr )
continue;
30 auto chamb =
dynamic_cast<const RPCChamber*
>( *iDet );
32 std::vector<const RPCRoll*> rolls = (chamb->rolls());
35 for(
auto& iRoll : rolls){
41 typedef std::pair<RPCRecHitCollection::const_iterator, RPCRecHitCollection::const_iterator> rangeRecHits;
42 rangeRecHits recHitCollection = recHits->get(rpcId);
50 int rawId = rpcId.
rawId();
52 int Bx = rechit_it->BunchX();
53 int isValid = rechit_it->isValid();
54 int firststrip = rechit_it->firstClusterStrip();
55 int clustersize = rechit_it->clusterSize();
64 int rechitstrip = firststrip;
68 if (clustersize % 2 == 0) medium = 0.5*(clustersize);
69 else medium = 0.5*(clustersize-1);
70 rechitstrip += medium;
73 if(clustersize > MaxClusterSize)
continue;
82 if ((global_phi > 15.) && (global_phi <= 16.3)) {
86 else if ((global_phi > 16.3) && (global_phi <= 53.)) {
90 else if ((global_phi > 53.) && (global_phi <= 75.)) {
95 else if ((global_phi > 75.) && (global_phi <= 76.3)) {
99 else if ((global_phi > 76.3) && (global_phi <= 113.)) {
103 else if ((global_phi > 113.) && (global_phi <= 135.)) {
109 else if ((global_phi > 135.) && (global_phi <= 136.3)) {
113 else if ((global_phi > 136.3) && (global_phi <= 173.)) {
117 else if ((global_phi > 173.) && (global_phi <= 180.)) {
122 else if ((global_phi < -165.) && (global_phi >= -180.)) {
127 else if ((global_phi > -165.) && (global_phi <= -163.7)) {
131 else if ((global_phi > -163.7) && (global_phi <= -127.)) {
135 else if ((global_phi > -127.) && (global_phi <= -105.)) {
140 else if ((global_phi > -105.) && (global_phi <= -103.7)) {
144 else if ((global_phi > -103.7) && (global_phi <= -67.)) {
148 else if ((global_phi > -67.) && (global_phi <= -45.)) {
153 else if ((global_phi > -45.) && (global_phi <= -43.7)) {
157 else if ((global_phi > -43.7) && (global_phi <= -7.)) {
161 else if ((global_phi > -7.) && (global_phi <= 15.)) {
172 double EMTFLink1 = 0.;
173 double EMTFLink2 = 0.;
175 std::vector<RecHitProcessor::CppfItem>::iterator cppf1;
176 std::vector<RecHitProcessor::CppfItem>::iterator cppf;
177 for(cppf1 = CppfVec1.begin(); cppf1 != CppfVec1.end(); cppf1++){
182 if(((*cppf1).rawId == rawId) && ((*cppf1).strip == rechitstrip)){
184 int old_strip = (*cppf1).strip;
188 if(cppf1 != CppfVec1.begin())
189 before = (*(cppf1-2)).
strip;
191 else if (cppf1 == CppfVec1.begin())
192 before = (*cppf1).strip;
194 if(cppf1 != CppfVec1.end())
195 after = (*(cppf1+2)).
strip;
197 else if (cppf1 == CppfVec1.end())
198 after = (*cppf1).strip;
202 if(clustersize == 2){
205 if(before < after) cppf=(cppf1-1);
206 else if (before > after) cppf=(cppf1+1);
208 else if(firststrip > 1){
209 if(before < after) cppf=(cppf1+1);
210 else if (before > after) cppf=(cppf1-1);
216 std::shared_ptr<l1t::CPPFDigi> MainVariables1(
new l1t::CPPFDigi(rpcId, Bx , (*cppf).int_phi, (*cppf).int_theta, isValid, (*cppf).lb, (*cppf).halfchannel, EMTFsector1, EMTFLink1, old_strip, clustersize, global_phi, global_theta));
217 std::shared_ptr<l1t::CPPFDigi> MainVariables2(
new l1t::CPPFDigi(rpcId, Bx , (*cppf).int_phi, (*cppf).int_theta, isValid, (*cppf).lb, (*cppf).halfchannel, EMTFsector2, EMTFLink2, old_strip, clustersize, global_phi, global_theta));
219 if ((EMTFsector1 > 0) && (EMTFsector2 == 0)){
220 cppfDigis.push_back(*MainVariables1.get());
222 else if ((EMTFsector1 > 0) && (EMTFsector2 > 0)){
223 cppfDigis.push_back(*MainVariables1.get());
224 cppfDigis.push_back(*MainVariables2.get());
226 else if ((EMTFsector1 == 0) && (EMTFsector2 == 0)) {
233 std::shared_ptr<l1t::CPPFDigi> MainVariables1(
new l1t::CPPFDigi(rpcId, Bx , (*cppf).int_phi, (*cppf).int_theta, isValid, (*cppf).lb, (*cppf).halfchannel, EMTFsector1, EMTFLink1, old_strip, clustersize, global_phi, global_theta));
234 std::shared_ptr<l1t::CPPFDigi> MainVariables2(
new l1t::CPPFDigi(rpcId, Bx , (*cppf).int_phi, (*cppf).int_theta, isValid, (*cppf).lb, (*cppf).halfchannel, EMTFsector2, EMTFLink2, old_strip, clustersize, global_phi, global_theta));
235 if ((EMTFsector1 > 0) && (EMTFsector2 == 0)){
236 cppfDigis.push_back(*MainVariables1.get());
238 else if ((EMTFsector1 > 0) && (EMTFsector2 > 0)){
239 cppfDigis.push_back(*MainVariables1.get());
240 cppfDigis.push_back(*MainVariables2.get());
242 else if ((EMTFsector1 == 0) && (EMTFsector2 == 0)) {
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Geom::Phi< T > phi() const
constexpr uint32_t rawId() const
get the raw id
const Plane & surface() const
The nominal surface of the GeomDet.
Geom::Theta< T > theta() const
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
double rad_to_deg(double rad)
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.