12 #define NUM_SECTORS 12
16 #include "L1Trigger/CSCTrackFinder/test/src/RefTrack.h"
34 using namespace L1TMuon;
41 produces<l1t::RegionalMuonCandBxCollection >(
"EMTF");
61 std::vector<TriggerPrimitive> tester;
71 std::vector<TriggerPrimitive>
out;
73 auto chamber = MDC->begin();
74 auto chend = MDC->end();
75 for( ; chamber != chend; ++chamber ) {
76 auto digi = (*chamber).second.first;
77 auto dend = (*chamber).second.second;
78 for( ; digi != dend; ++digi ) {
93 auto tp = out.cbegin();
94 auto tpend = out.cend();
96 for( ; tp != tpend; ++tp ) {
97 if(tp->subsystem() == 1)
101 tester.push_back(*tp);
111 for(
int SectIndex=0;SectIndex<
NUM_SECTORS;SectIndex++){
120 std::vector<ConvertedHit> ConvHits =
PrimConv(tester,SectIndex);
121 CHits[SectIndex] = ConvHits;
145 std::vector<std::vector<ConvertedHit>> GroupedHits =
GroupBX(ConvHits);
152 std::vector<ZonesOutput> Zout =
Zones(GroupedHits);
161 std::vector<PatternOutput> Pout =
Patterns(Zout);
184 MO[SectIndex] = Mout;
192 std::vector<std::vector<DeltaOutput>> Dout =
CalcDeltas(Mout);
202 PTracks[SectIndex] = Bout;
218 int windex[4] = {-1,-1,-1,-1};
222 for(
int i=0;
i<4;
i++){
224 for(
int j=0;
j<36;
j++){
227 if(!PTemp[
j/3][
j%3].
phi)
230 if((windex[0] ==
j) || (windex[1] ==
j) || (windex[2] ==
j) || (windex[3] ==
j))
233 if(PTracks[
j/3][
j%3].winner.Rank() > FourBest[
i].
winner.
Rank()){
235 FourBest[
i] = PTemp[
j/3][
j%3];
248 for(
int fbest=0;fbest<4;fbest++){
250 if(FourBest[fbest].
phi){
255 tempTrack.
phi = FourBest[fbest].
phi;
259 std::vector<int> ps, ts;
264 int me1address = 0, me2address = 0, CombAddress = 0,
mode = 0;
266 for(std::vector<ConvertedHit>::iterator
A = FourBest[fbest].AHits.begin();
A != FourBest[fbest].
AHits.end();
A++){
268 if(
A->Phi() != -999){
271 int id =
A->TP().getCSCData().cscID;
272 int trknm =
A->TP().getCSCData().trknmb;
275 ps.push_back(
A->Phi());
276 ts.push_back(
A->Theta());
281 case 1:
mode |= 8;
break;
282 case 2:
mode |= 4;
break;
283 case 3:
mode |= 2;
break;
284 case 4:
mode |= 1;
break;
292 if(station == 1 &&
id > 3 &&
id < 7){
295 if(
A->TP().detId<
CSCDetId>().chamber()%6 > 2)
300 me1address += 3*(sub - 1);
302 me1address |= trknm-1;
306 if(station == 2 &&
id > 3){
310 me2address = me2address<<1;
311 me2address |= trknm-1;
323 tempTrack.
pt = xmlpt*1.4;
326 CombAddress = (me2address<<4) | me1address;
330 CombAddress,
mode,1,sector);
333 float theta_angle = (FourBest[fbest].
theta*0.2851562 + 8.5)*(3.14159265359/180);
334 float eta = (-1)*
log(
tan(theta_angle/2));
335 if(!ME13 && fabs(eta) > 1.1)
336 OutputCands->push_back(bx, outCand);
342 ev.
put( OutputCands,
"EMTF");
T getParameter(std::string const &) const
SortingOutput SortSect(PatternOutput Pout)
L1TMuonEndCapTrackProducer(const PSet &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
l1t::RegionalMuonCand MakeRegionalCand(float pt, int phi, int theta, int sign, int quality, int trackaddress, int sector)
Geom::Theta< T > theta() const
void setType(unsigned type)
MatchingOutput PhiMatching(SortingOutput Sout)
std::vector< int > thetas
std::vector< PatternOutput > Patterns(std::vector< ZonesOutput > Zones)
std::vector< std::vector< int > > deltas
void addStub(const TriggerPrimitive &stub)
float CalculatePt(L1TMuon::InternalTrack track, const edm::EventSetup &es)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< ConvertedHit > AHits
Tan< T >::type tan(const T &t)
void produce(edm::Event &, const edm::EventSetup &)
std::vector< std::vector< int > > deltas
std::vector< ConvertedHit > PrimConv(std::vector< TriggerPrimitive > TriggPrim, int SectIndex)
Geom::Phi< T > phi() const
std::vector< BTrack > BestTracks(std::vector< std::vector< DeltaOutput >> Dout)
std::vector< std::vector< DeltaOutput > > CalcDeltas(MatchingOutput Mout)
PatternOutput DeleteDuplicatePatterns(std::vector< PatternOutput > Pout)
int phi
TEMPORARY ADDITION by G. Brown ///.
std::vector< std::vector< ConvertedHit > > GroupBX(std::vector< ConvertedHit > ConvHits)
std::vector< ZonesOutput > Zones(std::vector< std::vector< ConvertedHit >> Hits)
Int_t triggerSector(Int_t station, Int_t ring, Int_t chamber) const