CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1Comparator Class Reference

#include <L1Comparator.h>

Inheritance diagram for L1Comparator:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

template<class myCol >
bool CompareCollections (edm::Handle< myCol > data, edm::Handle< myCol > emul)
 
 L1Comparator (const edm::ParameterSet &)
 
 ~L1Comparator ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

virtual void beginJob (void)
 
virtual void beginRun (edm::Run &, const edm::EventSetup &)
 
bool compareCollections (edm::Handle< L1GlobalTriggerReadoutRecord > data, edm::Handle< L1GlobalTriggerReadoutRecord > emul)
 
bool compareCollections (edm::Handle< L1GlobalTriggerEvmReadoutRecord >data, edm::Handle< L1GlobalTriggerEvmReadoutRecord >emul)
 
bool compareCollections (edm::Handle< L1GlobalTriggerObjectMapRecord > data, edm::Handle< L1GlobalTriggerObjectMapRecord > emul)
 
template<class T >
bool CompareCollections (edm::Handle< T > data, edm::Handle< T > emul)
 
bool compareFedRawCollections (edm::Handle< FEDRawDataCollection > data, edm::Handle< FEDRawDataCollection > emul, int fedid)
 
template<class T >
bool dumpCandidate (const T &dt, const T &em, std::ostream &s)
 
virtual void endJob ()
 
template<class T >
void process (T const *, T const *, const int, const int)
 
template<class T >
void process (const edm::Handle< T > data, const edm::Handle< T > emul, const int sys, const int cid)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
int verbose ()
 

Private Attributes

bool DEmatchEvt [dedefs::DEnsys]
 
int DEncand [dedefs::DEnsys][2]
 
bool dumpEvent_
 
int evtNum_
 
L1DEDigiCollection m_dedigis
 
edm::InputTag m_DEsource [dedefs::DEnsys][4]
 
bool m_doSys [dedefs::DEnsys]
 
std::ofstream m_dumpFile
 
std::string m_dumpFileName
 
int m_dumpMode
 
int m_fedId
 
edm::InputTag m_FEDsource [2]
 
bool m_match
 
int nevt_
 
int runNum_
 
int verbose_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 43 of file L1Comparator.h.

Constructor & Destructor Documentation

L1Comparator::L1Comparator ( const edm::ParameterSet iConfig)
explicit

assertions/temporary

dump level: -1(all),0(none),1(disagree),2(loc.disagree),3(loc.agree)

create d|e record product

Definition at line 6 of file L1Comparator.cc.

References gather_cfg::cout, dedefs::CTF, dedefs::CTP, dedefs::DEnsys, dedefs::DTF, dedefs::DTP, dedefs::ETP, edm::hlt::Exception, dedefs::GCT, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), dedefs::GLT, dedefs::GMT, dedefs::HTP, i, j, dedefs::LTC, dbtoconf::out, dedefs::RCT, dedefs::RPC, dedefs::SystLabel, and validate_alignment_devdb10_cfg::verbose.

6  {
7 
8  verbose_ = iConfig.getUntrackedParameter<int>("VerboseFlag",0);
9 
10  if(verbose())
11  std::cout << "\nL1COMPARATOR constructor...\n" << std::flush;
12 
13  std::vector<unsigned int> dosys(0,DEnsys);
14  dosys =
15  iConfig.getUntrackedParameter<std::vector<unsigned int> >("COMPARE_COLLS", dosys);
16 
17  if((int)dosys.size()!=DEnsys)
18  edm::LogError("L1Comparator")
19  << "wrong selection of systems to be compared\n"
20  << "\t the size of the mask COMPARE_COLLS (" << dosys.size()
21  << ") is not " << DEnsys << std::endl;
22  assert((int)dosys.size()==DEnsys);
23 
24  for(int isys=0; isys<DEnsys; isys++)
25  if( dosys[isys]!=0 && dosys[isys]!=1 )
26  throw cms::Exception("Invalid configuration")
27  << "L1Comparator: comparison flag for system " << isys
28  << " is non boolean: " << dosys[isys] << ". Exiting.\n";
29 
30  for(int i=0; i<DEnsys; i++)
31  m_doSys[i] = dosys[i];
32 
33  if(verbose()) {
34  std::cout << "[L1Comparator] do sys? ";
35  for(int i=0; i<DEnsys; i++)
36  std::cout << m_doSys[i] << " ";
37  std::cout << std::endl;
38 
39  std::cout << "[L1Comparator] list of systems to process: ";
40  for(int i=0; i<DEnsys; i++)
41  if(m_doSys[i])
42  std::cout << SystLabel[i] << " ";
43  std::cout << std::endl;
44  }
45 
47  assert(ETP==0); assert(HTP==1); assert(RCT== 2); assert(GCT== 3);
48  assert(DTP==4); assert(DTF==5); assert(CTP== 6); assert(CTF== 7);
49  assert(RPC==8); assert(LTC==9); assert(GMT==10); assert(GLT==11);
50 
51  if(verbose())
52  std::cout << "[L1Comparator] debug print collection labels\n";
53 
54  m_DEsource[ETP][0] = iConfig.getParameter<edm::InputTag>("ETPsourceData");
55  m_DEsource[ETP][1] = iConfig.getParameter<edm::InputTag>("ETPsourceEmul");
56  m_DEsource[HTP][0] = iConfig.getParameter<edm::InputTag>("HTPsourceData");
57  m_DEsource[HTP][1] = iConfig.getParameter<edm::InputTag>("HTPsourceEmul");
58  m_DEsource[RCT][0] = iConfig.getParameter<edm::InputTag>("RCTsourceData");
59  m_DEsource[RCT][1] = iConfig.getParameter<edm::InputTag>("RCTsourceEmul");
60  m_DEsource[GCT][0] = iConfig.getParameter<edm::InputTag>("GCTsourceData");
61  m_DEsource[GCT][1] = iConfig.getParameter<edm::InputTag>("GCTsourceEmul");
62  m_DEsource[DTP][0] = iConfig.getParameter<edm::InputTag>("DTPsourceData");
63  m_DEsource[DTP][1] = iConfig.getParameter<edm::InputTag>("DTPsourceEmul");
64  m_DEsource[DTF][0] = iConfig.getParameter<edm::InputTag>("DTFsourceData");
65  m_DEsource[DTF][1] = iConfig.getParameter<edm::InputTag>("DTFsourceEmul");
66  m_DEsource[CTP][0] = iConfig.getParameter<edm::InputTag>("CTPsourceData");
67  m_DEsource[CTP][1] = iConfig.getParameter<edm::InputTag>("CTPsourceEmul");
68  m_DEsource[CTF][0] = iConfig.getParameter<edm::InputTag>("CTFsourceData");
69  m_DEsource[CTF][1] = iConfig.getParameter<edm::InputTag>("CTFsourceEmul");
70  m_DEsource[CTF][2] = iConfig.getParameter<edm::InputTag>("CTTsourceData");
71  m_DEsource[CTF][3] = iConfig.getParameter<edm::InputTag>("CTTsourceEmul");
72  m_DEsource[RPC][0] = iConfig.getParameter<edm::InputTag>("RPCsourceData");
73  m_DEsource[RPC][1] = iConfig.getParameter<edm::InputTag>("RPCsourceEmul");
74  m_DEsource[LTC][0] = iConfig.getParameter<edm::InputTag>("LTCsourceData");
75  m_DEsource[LTC][1] = iConfig.getParameter<edm::InputTag>("LTCsourceEmul");
76  m_DEsource[GMT][0] = iConfig.getParameter<edm::InputTag>("GMTsourceData");
77  m_DEsource[GMT][1] = iConfig.getParameter<edm::InputTag>("GMTsourceEmul");
78  m_DEsource[GLT][0] = iConfig.getParameter<edm::InputTag>("GLTsourceData");
79  m_DEsource[GLT][1] = iConfig.getParameter<edm::InputTag>("GLTsourceEmul");
80 
81  for(int sys=0; sys<DEnsys; sys++) {
82  std::string data_label = SystLabel[sys] + "sourceData";
83  std::string emul_label = SystLabel[sys] + "sourceEmul";
84  //m_DEsource[sys][0] = iConfig.getParameter<edm::InputTag>(data_label);
85  //m_DEsource[sys][1] = iConfig.getParameter<edm::InputTag>(emul_label);
86  //if(sys==CTF) {
87  // std::string data_label(""); data_label+="CTTsourceData";
88  // std::string emul_label(""); emul_label+="CTTsourceEmul";
89  // m_DEsource[sys][2] = iConfig.getParameter<edm::InputTag>(data_label);
90  // m_DEsource[sys][3] = iConfig.getParameter<edm::InputTag>(emul_label);
91  //}
92  if(m_doSys[sys] && verbose()) {
93  std::cout << " sys:" << sys << " label:" << SystLabel[sys]
94  << "\n\tdt:" << data_label << " : " <<m_DEsource[sys][0]
95  << "\n\tem:" << emul_label << " : " <<m_DEsource[sys][1]
96  << std::endl;
97  if(sys==CTF) {
98  std::cout << "\tdt:" << data_label << " : " <<m_DEsource[sys][2]
99  << "\n\tem:" << emul_label << " : " <<m_DEsource[sys][3]
100  << std::endl;
101  }
102  }
103  }
104 
105 
106  m_fedId = iConfig.getUntrackedParameter<int>("FEDid", 0);
107  m_FEDsource[0] =
108  iConfig.getUntrackedParameter<edm::InputTag>("FEDsourceData",edm::InputTag());
109  m_FEDsource[1] =
110  iConfig.getUntrackedParameter<edm::InputTag>("FEDsourceEmul",edm::InputTag());
111 
112 
114  m_dumpMode = iConfig.getUntrackedParameter<int>("DumpMode",0);
115  m_dumpFileName = iConfig.getUntrackedParameter<std::string>("DumpFile","");
116  if(m_dumpMode) {
117  m_dumpFile.open(m_dumpFileName.c_str(), std::ios::out);
118  if(!m_dumpFile.good())
119  edm::LogInfo("L1ComparatorDumpFileOpenError")
120  << " L1Comparator::L1Comparator() : "
121  << " couldn't open dump file " << m_dumpFileName.c_str() << std::endl;
122  }
123 
124  m_match = true;
125  dumpEvent_ = true;
126  nevt_=-1;
127 
128  for(int i=0; i<DEnsys; i++) {
129  for(int j=0; j<2; j++)
130  DEncand[i][j] = 0;
131  DEmatchEvt[i] = true;
132  }
133 
134  m_dedigis.clear();
136  produces<L1DataEmulRecord>().setBranchAlias("L1DataEmulRecord");
137 
138  if(verbose())
139  std::cout << "\nL1Comparator constructor...done.\n" << std::flush;
140 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
const int DEnsys
Definition: DEtrait.h:38
int DEncand[dedefs::DEnsys][2]
Definition: L1Comparator.h:95
std::string m_dumpFileName
Definition: L1Comparator.h:90
edm::InputTag m_FEDsource[2]
Definition: L1Comparator.h:99
edm::InputTag m_DEsource[dedefs::DEnsys][4]
Definition: L1Comparator.h:88
int j
Definition: DBlmapReader.cc:9
Definition: L1GtFwd.h:20
tuple out
Definition: dbtoconf.py:99
bool DEmatchEvt[dedefs::DEnsys]
Definition: L1Comparator.h:94
const std::string SystLabel[DEnsys]
Definition: DEtrait.h:45
L1DEDigiCollection m_dedigis
Definition: L1Comparator.h:96
std::ofstream m_dumpFile
Definition: L1Comparator.h:91
tuple cout
Definition: gather_cfg.py:41
bool m_doSys[dedefs::DEnsys]
Definition: L1Comparator.h:89
L1Comparator::~L1Comparator ( )

Definition at line 143 of file L1Comparator.cc.

143 {}

Member Function Documentation

void L1Comparator::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 145 of file L1Comparator.cc.

145 {}
void L1Comparator::beginRun ( edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 147 of file L1Comparator.cc.

References gather_cfg::cout, dedefs::CTF, dedefs::DTF, dedefs::GCT, edm::EventSetup::get(), dedefs::GLT, dedefs::GMT, L1TriggerKey::kCSCTF, L1TriggerKey::kDTTF, L1TriggerKey::kGCT, L1TriggerKey::kGMT, L1TriggerKey::kGT, L1TriggerKey::kRCT, L1TriggerKey::kRPC, dedefs::RCT, dedefs::RPC, and validate_alignment_devdb10_cfg::verbose.

147  {
148 
149  if(verbose())
150  std::cout << "\nL1COMPARATOR beginRun...\n" << std::flush;
151 
152 
153  // disable subsystem if not included in current run configuration
154  try
155  {
157  iSetup.get< L1TriggerKeyRcd >().get( pKey ) ;
158 
159  m_doSys[RCT] &= (!(pKey->subsystemKey( L1TriggerKey::kRCT) .empty()));
160  m_doSys[GCT] &= (!(pKey->subsystemKey( L1TriggerKey::kGCT) .empty()));
161  m_doSys[DTF] &= (!(pKey->subsystemKey( L1TriggerKey::kDTTF) .empty()));
162  m_doSys[CTF] &= (!(pKey->subsystemKey( L1TriggerKey::kCSCTF).empty()));
163  m_doSys[RPC] &= (!(pKey->subsystemKey( L1TriggerKey::kRPC) .empty()));
164  m_doSys[GMT] &= (!(pKey->subsystemKey( L1TriggerKey::kGMT) .empty()));
165  m_doSys[GLT] &= (!(pKey->subsystemKey( L1TriggerKey::kGT) .empty()));
166 
167  if(verbose()) {
168  if ( pKey->subsystemKey( L1TriggerKey::kRCT ).empty() )
169  std::cout << "RCT key is empty. Sub-systems is disabled ("<<m_doSys[RCT]<<")\n";
170  if ( pKey->subsystemKey( L1TriggerKey::kGCT ).empty() )
171  std::cout << "GCT key is empty. Sub-systems is disabled ("<<m_doSys[GCT]<<")\n";
172  if ( pKey->subsystemKey( L1TriggerKey::kDTTF ).empty() )
173  std::cout << "DTTF key is empty. Sub-systems is disabled ("<<m_doSys[DTF]<<")\n";
174  if ( pKey->subsystemKey( L1TriggerKey::kCSCTF).empty() )
175  std::cout << "CSCTF key is empty. Sub-systems is disabled ("<<m_doSys[CTF]<<")\n";
176  if ( pKey->subsystemKey( L1TriggerKey::kRPC ).empty() )
177  std::cout << "RPC key is empty. Sub-systems is disabled ("<<m_doSys[RPC]<<")\n";
178  if ( pKey->subsystemKey( L1TriggerKey::kGMT ).empty() )
179  std::cout << "GMT key is empty. Sub-systems is disabled ("<<m_doSys[GMT]<<")\n";
180  if ( pKey->subsystemKey( L1TriggerKey::kGT ).empty() )
181  std::cout << "GT key is empty. Sub-systems is disabled ("<<m_doSys[GLT]<<")\n";
182  std::cout << "TSC key = " << pKey->tscKey() << std::endl;
183  }
184 
185  //access subsystem key if needed, eg:
186  //std::cout << "RCT key:" << pKey->subsystemKey( L1TriggerKey::kRCT ) << std::endl;
187  }
188  catch( cms::Exception& ex )
189  {
190  edm::LogWarning("L1Comparator")
191  << "No L1TriggerKey found."
192  << std::endl;
193  }
194 
195  if(verbose())
196  std::cout << "L1COMPARATOR beginRun... done\n" << std::flush;
197 
198 }
Definition: L1GtFwd.h:20
const T & get() const
Definition: EventSetup.h:55
tuple cout
Definition: gather_cfg.py:41
bool m_doSys[dedefs::DEnsys]
Definition: L1Comparator.h:89
bool L1Comparator::compareCollections ( edm::Handle< L1GlobalTriggerReadoutRecord data,
edm::Handle< L1GlobalTriggerReadoutRecord emul 
)
private

todo: skip empty events

todo printL1Objects!

debug: print it all ()

Definition at line 1074 of file L1Comparator.cc.

References gather_cfg::cout, i, match(), convertSQLiteXML::ok, edm::Handle< T >::product(), and validate_alignment_devdb10_cfg::verbose.

1075  {
1076 
1077  if(verbose())
1078  std::cout << "L1Comparator -- result of GT embedded comparison.\n"
1079  << "L1GlobalTriggerReadoutRecord:: data and emulator agree? "
1080  << ((*data==*emul)?"yes":"no")
1081  << std::endl;
1082 
1083  m_dumpFile << "\n L1GlobalTriggerReadoutRecord candidates...\n";
1084 
1085  bool thematch = true;
1086 
1087  thematch &= (*data==*emul);
1088 
1089  bool match = thematch;
1090 
1091  if(m_dumpMode==0 && match)
1092  return match;
1093 
1094  //expand to check mismatching stage
1095 
1096  //need to create new objects due to lack of suitable accessors
1097  // needed only for accessing gtPsbVector()
1098  std::auto_ptr<L1GlobalTriggerReadoutRecord>
1099  data_( new L1GlobalTriggerReadoutRecord(*(data.product())));
1100  std::auto_ptr<L1GlobalTriggerReadoutRecord>
1101  emul_( new L1GlobalTriggerReadoutRecord(*(emul.product())));
1102 
1103  match = true;
1104  m_dumpFile << "\tmatch stage: ";
1105  match &= (data->gtfeWord() == emul->gtfeWord() );
1106  m_dumpFile << " gtfeWord:" << match;
1107  match &= (data->gtFdlWord() == emul->gtFdlWord() );
1108  m_dumpFile << " gtFdlWord:" << match;
1109  match &= (data->muCollectionRefProd() == emul->muCollectionRefProd());
1110  m_dumpFile << " muCollectionRefProd:" << match << "\n";
1111  boost::uint16_t dt_psb_bid=0, em_psb_bid=0;
1112  size_t npsbw = (data_->gtPsbVector().size()>emul_->gtPsbVector().size())?
1113  emul_->gtPsbVector().size():data_->gtPsbVector().size();
1114  for(int idx=0; idx<(int)npsbw; idx++) {
1115  if(data_->gtPsbVector().at(idx) != emul_->gtPsbVector().at(idx) ) {
1116  //match &= false;
1117  dt_psb_bid = data_->gtPsbVector().at(idx).boardId();
1118  em_psb_bid = emul_->gtPsbVector().at(idx).boardId();
1119  break;
1120  }
1121  }
1122  match &= (data->gtPsbWord(dt_psb_bid) == emul->gtPsbWord(em_psb_bid) );
1123  //if(!match) {
1124  // m_dumpFile << " data"; data_->gtPsbWord(dt_psb_bid).print(m_dumpFile);
1125  // m_dumpFile << "\nemul"; emul_->gtPsbWord(em_psb_bid).print(m_dumpFile);
1126  //}
1127  //problem: vector not accessible from handle (only reference non-const)
1128  //std::vector<L1GtPsbWord>& data_psbVec = data_->gtPsbVector();
1129  //std::vector<L1GtPsbWord>& emul_psbVec = emul_->gtPsbVector();
1130  m_dumpFile << " gtPsbWord("<<dt_psb_bid<<","<<em_psb_bid<<"):" << match << "\n";
1131 
1133 
1134  // gt decision
1135  m_dumpFile << "\n\tGlobal decision: "
1136  << data->decision() << " (data) "
1137  << emul->decision() << " (emul) "
1138  << std::endl;
1139 
1140  // gt decision word
1141  m_dumpFile << "\n\tDecisionWord (bits: 63:0, 127:64)";
1142  int nbitword = 64;
1143  std::vector<bool> data_gtword = data->decisionWord();
1144  std::vector<bool> emul_gtword = emul->decisionWord();
1145  m_dumpFile << "\n\tdata: ";
1146  for(int i=0; i<nbitword; i++) {
1147  if (i%16==0) m_dumpFile << " ";
1148  m_dumpFile << (data_gtword.at(nbitword-1-i) ? '1' : '0');
1149  }
1150  m_dumpFile << "\n\t ";
1151  for(int i=0; i<nbitword; i++) {
1152  if (i%16==0) m_dumpFile << " ";
1153  m_dumpFile << (data_gtword.at(nbitword*2-1-i) ? '1' : '0');
1154  }
1155  m_dumpFile << "\n\temul: ";
1156  for(int i=0; i<nbitword; i++) {
1157  if (i%16==0) m_dumpFile << " ";
1158  m_dumpFile << (emul_gtword.at(nbitword-1-i) ? '1' : '0');
1159  }
1160  m_dumpFile << "\n\t ";
1161  for(int i=0; i<nbitword; i++) {
1162  if (i%16==0) m_dumpFile << " ";
1163  m_dumpFile << (emul_gtword.at(nbitword*2-1-i) ? '1' : '0');
1164  }
1165  m_dumpFile << std::endl;
1166 
1167  m_dumpFile << "\n\tDecisionWordExtended (bits: 0:63)";
1168  std::vector<bool> data_decwext = data->gtFdlWord().gtDecisionWordExtended();
1169  std::vector<bool> emul_decwext = emul->gtFdlWord().gtDecisionWordExtended();
1170  m_dumpFile << "\n\tdata: ";
1171  for(int i=0; i<nbitword; i++) {
1172  if (i%16==0) m_dumpFile << " ";
1173  m_dumpFile << (data_decwext.at(nbitword-1-i) ? '1' : '0');
1174  }
1175  m_dumpFile << "\n\temul: ";
1176  for(int i=0; i<nbitword; i++) {
1177  if (i%16==0) m_dumpFile << " ";
1178  m_dumpFile << (emul_decwext.at(nbitword-1-i) ? '1' : '0');
1179  }
1180  m_dumpFile << std::endl;
1181 
1182  m_dumpFile << "\n\tTechnical triggers (bits: 0:63)";
1183  std::vector<bool> data_fdlttw = data->gtFdlWord().gtTechnicalTriggerWord();
1184  std::vector<bool> emul_fdlttw = emul->gtFdlWord().gtTechnicalTriggerWord();
1185  assert((int)data_fdlttw.size()==nbitword);
1186  m_dumpFile << "\n\tdata: ";
1187  for(int i=0; i<nbitword; i++) {
1188  if (i%16==0) m_dumpFile << " ";
1189  m_dumpFile << (data_fdlttw.at(nbitword-1-i) ? '1' : '0');
1190  }
1191  m_dumpFile << "\n\temul: ";
1192  for(int i=0; i<nbitword; i++) {
1193  if (i%16==0) m_dumpFile << " ";
1194  m_dumpFile << (emul_fdlttw.at(nbitword-1-i) ? '1' : '0');
1195  }
1196  m_dumpFile << std::endl;
1197 
1198  m_dumpFile << "\n\tL1GtFdlWord";
1199  m_dumpFile << "\n\tdata: "
1200  << " BoardId:" << data->gtFdlWord().boardId()
1201  << " BxInEvent:" << data->gtFdlWord().bxInEvent()
1202  << " BxNr:" << data->gtFdlWord().bxNr()
1203  << " EventNr:" << data->gtFdlWord().eventNr()
1204  << " NoAlgo:" << data->gtFdlWord().noAlgo()
1205  << " FinalOR:" << data->gtFdlWord().finalOR()
1206  << " LocalBxNr:" << data->gtFdlWord().localBxNr();
1207  m_dumpFile << "\n\temul: "
1208  << " BoardId:" << emul->gtFdlWord().boardId()
1209  << " BxInEvent:" << emul->gtFdlWord().bxInEvent()
1210  << " BxNr:" << emul->gtFdlWord().bxNr()
1211  << " EventNr:" << emul->gtFdlWord().eventNr()
1212  << " NoAlgo:" << emul->gtFdlWord().noAlgo()
1213  << " FinalOR:" << emul->gtFdlWord().finalOR()
1214  << " LocalBxNr:" << emul->gtFdlWord().localBxNr()
1215  << std::endl;
1216 
1217  m_dumpFile << "\n\tL1GtfeWord";
1218  m_dumpFile << "\n\tdata: "
1219  << " BoardId:" << data->gtfeWord().boardId()
1220  << " RecordLength:" << data->gtfeWord().recordLength()
1221  << " BxNr:" << data->gtfeWord().bxNr()
1222  << " SetupVersion:" << data->gtfeWord().setupVersion()
1223  << " ActiveBoards:" << data->gtfeWord().activeBoards()
1224  << " TotalTriggerNr:" << data->gtfeWord().totalTriggerNr();
1225  m_dumpFile << "\n\temul: "
1226  << " BoardId:" << emul->gtfeWord().boardId()
1227  << " RecordLength:" << emul->gtfeWord().recordLength()
1228  << " BxNr:" << emul->gtfeWord().bxNr()
1229  << " SetupVersion:" << emul->gtfeWord().setupVersion()
1230  << " ActiveBoards:" << emul->gtfeWord().activeBoards()
1231  << " TotalTriggerNr:" << emul->gtfeWord().totalTriggerNr()
1232  << std::endl;
1233 
1234  //uint16_t psb_bid = (uint16_t)idx; //need to find relevant board-id to dump
1235  m_dumpFile << "\n\tgtPsbWord";
1236  m_dumpFile << "\n\tdata: "
1237  << " Board Id:" << data->gtPsbWord(dt_psb_bid).boardId()
1238  << " BxInEvent:" << data->gtPsbWord(dt_psb_bid).bxInEvent()
1239  << " BxNr:" << data->gtPsbWord(dt_psb_bid).bxNr()
1240  << " LocalBxNr:" << data->gtPsbWord(dt_psb_bid).localBxNr()
1241  << " EventNr:" << data->gtPsbWord(dt_psb_bid).eventNr();
1242  m_dumpFile << "\n\temul: "
1243  << " Board Id:" << emul->gtPsbWord(em_psb_bid).boardId()
1244  << " BxInEvent:" << emul->gtPsbWord(em_psb_bid).bxInEvent()
1245  << " BxNr:" << emul->gtPsbWord(em_psb_bid).bxNr()
1246  << " LocalBxNr:" << emul->gtPsbWord(em_psb_bid).localBxNr()
1247  << " EventNr:" << emul->gtPsbWord(em_psb_bid).eventNr()
1248  << std::endl;
1249 
1250  // m_dumpFile << "\n\tA,B_Data_CH7:0"
1251  // << " ...waiting for data accessors in dataformats!\n\n";
1252  //#include "DataFormats/L1GlobalTrigger/src/L1GtPsbWord.cc"
1253 
1254  m_dumpFile << "\n\tA_Data_CH7:0";
1255  m_dumpFile << "\n\tdata: ";
1256  for (int i=0; i<8; ++i)
1257  m_dumpFile << data->gtPsbWord(dt_psb_bid).aData(7-i) << " ";
1258  m_dumpFile << "\n\temul: ";
1259  for (int i=0; i<8; ++i)
1260  m_dumpFile << emul->gtPsbWord(em_psb_bid).aData(7-i) << " ";
1261  m_dumpFile << std::endl;
1262 
1263  m_dumpFile << "\n\tA_Data_CH7:0";
1264  m_dumpFile << "\n\tdata: ";
1265  for (int i=0; i<8; ++i)
1266  m_dumpFile << data->gtPsbWord(dt_psb_bid).bData(7-i) << " ";
1267  m_dumpFile << "\n\temul: ";
1268  for (int i=0; i<8; ++i)
1269  m_dumpFile << emul->gtPsbWord(em_psb_bid).bData(7-i) << " ";
1270  m_dumpFile << "\n" << std::endl;
1271 
1272 
1274 
1276  if(false) {
1277  m_dumpFile << "---debug: print full gt record---";
1278  m_dumpFile << "\n\tdata: ";
1279  data->print(m_dumpFile);
1280  m_dumpFile << "\n\temul: ";
1281  emul->print(m_dumpFile);
1282  m_dumpFile << "\n";
1283  m_dumpFile << "---debug: print full gt record Done.---\n\n";
1284  }
1285 
1286  char ok[10];
1287  if(match) sprintf(ok,"successful");
1288  else sprintf(ok,"failed");
1289  m_dumpFile << " ...L1GlobalTriggerReadoutRecord data and emulator comparison: "
1290  << ok << std::endl;
1291 
1292  return thematch;
1293 }
int i
Definition: DBlmapReader.cc:9
T const * product() const
Definition: Handle.h:74
std::ofstream m_dumpFile
Definition: L1Comparator.h:91
tuple cout
Definition: gather_cfg.py:41
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
bool L1Comparator::compareCollections ( edm::Handle< L1GlobalTriggerEvmReadoutRecord data,
edm::Handle< L1GlobalTriggerEvmReadoutRecord emul 
)
private

Definition at line 1297 of file L1Comparator.cc.

References gather_cfg::cout, i, match(), convertSQLiteXML::ok, and validate_alignment_devdb10_cfg::verbose.

1298  {
1299 
1300  if(verbose())
1301  std::cout << "L1Comparator -- result of GT embedded comparison.\n"
1302  << "L1GlobalTriggerEvmReadoutRecord data and emulator agree? "
1303  << ((*data==*emul)?"yes":"no")
1304  << std::endl;
1305 
1306  m_dumpFile << "\n L1GlobalTriggerEvmReadoutRecord candidates...\n";
1307 
1308  bool match = true;
1309  match &= (*data==*emul);
1310 
1311  if(m_dumpMode==0 && match)
1312  return match;
1313 
1314  // gt decision
1315  m_dumpFile << "\n\tGlobal decision: "
1316  << data->decision() << " (data) "
1317  << emul->decision() << " (emul) "
1318  << std::endl;
1319 
1320  // gt decision word
1321  m_dumpFile << "\n\tDecisionWord (bits: 0:63, 127:64)";
1322  int nbitword = 64;
1323  std::vector<bool> data_gtword = data->decisionWord();
1324  std::vector<bool> emul_gtword = emul->decisionWord();
1325  m_dumpFile << "\n\tdata: ";
1326  for(int i=0; i<nbitword; i++) {
1327  if (i%16==0) m_dumpFile << " ";
1328  m_dumpFile << (data_gtword.at(nbitword-1-i) ? '1' : '0');
1329  }
1330  m_dumpFile << "\n\t ";
1331  for(int i=0; i<nbitword; i++) {
1332  if (i%16==0) m_dumpFile << " ";
1333  m_dumpFile << (data_gtword.at(nbitword*2-1-i) ? '1' : '0');
1334  }
1335  m_dumpFile << "\n\temul: ";
1336  for(int i=0; i<nbitword; i++) {
1337  if (i%16==0) m_dumpFile << " ";
1338  m_dumpFile << (emul_gtword.at(nbitword-1-i) ? '1' : '0');
1339  }
1340  m_dumpFile << "\n\t ";
1341  for(int i=0; i<nbitword; i++) {
1342  if (i%16==0) m_dumpFile << " ";
1343  m_dumpFile << (emul_gtword.at(nbitword*2-1-i) ? '1' : '0');
1344  }
1345  m_dumpFile << std::endl;
1346 
1347  m_dumpFile << "\n\tDecisionWordExtended (bits: 0:63)";
1348  std::vector<bool> data_decwext = data->gtFdlWord().gtDecisionWordExtended();
1349  std::vector<bool> emul_decwext = emul->gtFdlWord().gtDecisionWordExtended();
1350  m_dumpFile << "\n\tdata: ";
1351  for(int i=0; i<nbitword; i++) {
1352  if (i%16==0) m_dumpFile << " ";
1353  m_dumpFile << (data_decwext.at(nbitword-1-i) ? '1' : '0');
1354  }
1355  m_dumpFile << "\n\temul: ";
1356  for(int i=0; i<nbitword; i++) {
1357  if (i%16==0) m_dumpFile << " ";
1358  m_dumpFile << (emul_decwext.at(nbitword-1-i) ? '1' : '0');
1359  }
1360  m_dumpFile << std::endl;
1361 
1362  m_dumpFile << "\n\tTechnical triggers (bits: 0:63)";
1363  std::vector<bool> data_fdlttw = data->gtFdlWord().gtTechnicalTriggerWord();
1364  std::vector<bool> emul_fdlttw = emul->gtFdlWord().gtTechnicalTriggerWord();
1365  assert((int)data_fdlttw.size()==nbitword);
1366  m_dumpFile << "\n\tdata: ";
1367  for(int i=0; i<nbitword; i++) {
1368  if (i%16==0) m_dumpFile << " ";
1369  m_dumpFile << (data_fdlttw.at(nbitword-1-i) ? '1' : '0');
1370  }
1371  m_dumpFile << "\n\temul: ";
1372  for(int i=0; i<nbitword; i++) {
1373  if (i%16==0) m_dumpFile << " ";
1374  m_dumpFile << (emul_fdlttw.at(nbitword-1-i) ? '1' : '0');
1375  }
1376  m_dumpFile << std::endl;
1377 
1378  m_dumpFile << "\n\tL1GtFdlWord";
1379  m_dumpFile << "\n\tdata: "
1380  << " BoardId:" << data->gtFdlWord().boardId()
1381  << " BxInEvent:" << data->gtFdlWord().bxInEvent()
1382  << " BxNr:" << data->gtFdlWord().bxNr()
1383  << " EventNr:" << data->gtFdlWord().eventNr()
1384  << " NoAlgo:" << data->gtFdlWord().noAlgo()
1385  << " FinalOR:" << data->gtFdlWord().finalOR()
1386  << " LocalBxNr:" << data->gtFdlWord().localBxNr();
1387  m_dumpFile << "\n\temul: "
1388  << " BoardId:" << emul->gtFdlWord().boardId()
1389  << " BxInEvent:" << emul->gtFdlWord().bxInEvent()
1390  << " BxNr:" << emul->gtFdlWord().bxNr()
1391  << " EventNr:" << emul->gtFdlWord().eventNr()
1392  << " NoAlgo:" << emul->gtFdlWord().noAlgo()
1393  << " FinalOR:" << emul->gtFdlWord().finalOR()
1394  << " LocalBxNr:" << emul->gtFdlWord().localBxNr()
1395  << std::endl;
1396 
1397  m_dumpFile << "\n\tL1GtfeWord";
1398  m_dumpFile << "\n\tdata: "
1399  << " BoardId:" << data->gtfeWord().boardId()
1400  << " RecordLength:" << data->gtfeWord().recordLength()
1401  << " BxNr:" << data->gtfeWord().bxNr()
1402  << " SetupVersion:" << data->gtfeWord().setupVersion()
1403  << " ActiveBoards:" << data->gtfeWord().activeBoards()
1404  << " TotalTriggerNr:" << data->gtfeWord().totalTriggerNr();
1405  m_dumpFile << "\n\temul: "
1406  << " BoardId:" << emul->gtfeWord().boardId()
1407  << " RecordLength:" << emul->gtfeWord().recordLength()
1408  << " BxNr:" << emul->gtfeWord().bxNr()
1409  << " SetupVersion:" << emul->gtfeWord().setupVersion()
1410  << " ActiveBoards:" << emul->gtfeWord().activeBoards()
1411  << " TotalTriggerNr:" << emul->gtfeWord().totalTriggerNr()
1412  << std::endl;
1413 
1414  // -- tcs
1415  m_dumpFile << "\n\ttcsWord";
1416  m_dumpFile << "\n\tdata:"
1417  << " DaqNr:" << data->tcsWord().daqNr()
1418  << " TriggerType:" << data->tcsWord().triggerType()
1419  << " Status:" << data->tcsWord().status()
1420  << " BxNr:" << data->tcsWord().bxNr()
1421  << " PartTrigNr:" << data->tcsWord().partTrigNr()
1422  << " EventNr:" << data->tcsWord().eventNr() << "\n\t"
1423  << " AssignedPartitions:" << data->tcsWord().assignedPartitions()
1424  << " PartRunNr:" << data->tcsWord().partTrigNr()
1425  << " OrbitNr:" << data->tcsWord().orbitNr();
1426  m_dumpFile << "\n\temul:"
1427  << " DaqNr:" << emul->tcsWord().daqNr()
1428  << " TriggerType:" << emul->tcsWord().triggerType()
1429  << " Status:" << emul->tcsWord().status()
1430  << " BxNr:" << emul->tcsWord().bxNr()
1431  << " PartTrigNr:" << emul->tcsWord().partTrigNr()
1432  << " EventNr:" << emul->tcsWord().eventNr() << "\n\t"
1433  << " AssignedPartitions:" << emul->tcsWord().assignedPartitions()
1434  << " PartRunNr:" << emul->tcsWord().partTrigNr()
1435  << " OrbitNr:" << emul->tcsWord().orbitNr()
1436  << "\n" << std::endl;
1437 
1438  char ok[10];
1439  if(match) sprintf(ok,"successful");
1440  else sprintf(ok,"failed");
1441  m_dumpFile << " ...L1GlobalTriggerEvmReadoutRecord data and emulator comparison: "
1442  << ok << std::endl;
1443 
1444  return match;
1445 }
int i
Definition: DBlmapReader.cc:9
std::ofstream m_dumpFile
Definition: L1Comparator.h:91
tuple cout
Definition: gather_cfg.py:41
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
bool L1Comparator::compareCollections ( edm::Handle< L1GlobalTriggerObjectMapRecord data,
edm::Handle< L1GlobalTriggerObjectMapRecord emul 
)
private

Definition at line 1449 of file L1Comparator.cc.

References i, match(), and convertSQLiteXML::ok.

1450  {
1451 
1452  m_dumpFile << "\n L1GlobalTriggerObjectMapRecord candidates...\n";
1453 
1454  bool match = true;
1455  //match &= (*data==*emul);
1456 
1457  const std::vector<L1GlobalTriggerObjectMap>& data_ovec = data->gtObjectMap();
1458  const std::vector<L1GlobalTriggerObjectMap>& emul_ovec = emul->gtObjectMap();
1459 
1460  for(std::vector<L1GtLogicParser::OperandToken>::size_type idx=0; idx<data_ovec.size(); idx++) {
1461  match &= ( data_ovec.at(idx).algoName() == emul_ovec.at(idx).algoName() );
1462  match &= ( data_ovec.at(idx).algoBitNumber() == emul_ovec.at(idx).algoBitNumber() );
1463  match &= ( data_ovec.at(idx).algoGtlResult() == emul_ovec.at(idx).algoGtlResult() );
1464  match &= ( data_ovec.at(idx).combinationVector() == emul_ovec.at(idx).combinationVector() );
1465  match &= ( data_ovec.at(idx).operandTokenVector().size()==emul_ovec.at(idx).operandTokenVector().size());
1466  if(match) {
1467  for(std::vector<L1GtLogicParser::OperandToken>::size_type i=0; i<data_ovec.at(idx).operandTokenVector().size(); i++) {
1468  match &= ( data_ovec.at(idx).operandTokenVector().at(i).tokenName ==
1469  emul_ovec.at(idx).operandTokenVector().at(i).tokenName );
1470  match &= ( data_ovec.at(idx).operandTokenVector().at(i).tokenNumber ==
1471  emul_ovec.at(idx).operandTokenVector().at(i).tokenNumber );
1472  match &= ( data_ovec.at(idx).operandTokenVector().at(i).tokenResult ==
1473  emul_ovec.at(idx).operandTokenVector().at(i).tokenResult );
1474  }
1475  }
1476  }
1477 
1478  if(m_dumpMode==0 && match)
1479  return match;
1480 
1481  // dump
1482  int idx = 0;
1483  m_dumpFile << "\n\tL1GlobalTriggerObjectMap";
1484  m_dumpFile << "\n\tdata: "
1485  << " algorithmName:" << data_ovec.at(idx).algoName()
1486  << " Bitnumber:" << data_ovec.at(idx).algoBitNumber()
1487  << " GTLresult:" << data_ovec.at(idx).algoGtlResult()
1488  << " combinationVectorSize:" << data_ovec.at(idx).combinationVector().size()
1489  << " operandTokenVector:" << data_ovec.at(idx).operandTokenVector().size();
1490  m_dumpFile << "\n\temul: "
1491  << " algorithmName:" << emul_ovec.at(idx).algoName()
1492  << " Bitnumber:" << emul_ovec.at(idx).algoBitNumber()
1493  << " GTLresult:" << emul_ovec.at(idx).algoGtlResult()
1494  << " combinationVectorSize:" << emul_ovec.at(idx).combinationVector().size()
1495  << " operandTokenVector:" << emul_ovec.at(idx).operandTokenVector().size()
1496  << "\n" << std::endl;
1497 
1498  char ok[10];
1499  if(match) sprintf(ok,"successful");
1500  else sprintf(ok,"failed");
1501  m_dumpFile << " ...L1GlobalTriggerObjectMapRecord data and emulator comparison: "
1502  << ok << std::endl;
1503 
1504  return match;
1505 }
int i
Definition: DBlmapReader.cc:9
uint16_t size_type
std::ofstream m_dumpFile
Definition: L1Comparator.h:91
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
template<class T >
bool L1Comparator::CompareCollections ( edm::Handle< T data,
edm::Handle< T emul 
)
private
template<class myCol >
bool L1Comparator::CompareCollections ( edm::Handle< myCol >  data,
edm::Handle< myCol >  emul 
)

Definition at line 1546 of file L1Comparator.cc.

References begin, i, and match().

1546  {
1547  bool match = true;
1548  typedef typename myCol::size_type col_sz;
1549  typedef typename myCol::iterator col_it;
1550  col_sz ndata = data->size();
1551  col_sz nemul = emul->size();
1552  if(ndata!=nemul) {
1553  match &= false;
1554  m_dumpFile << " #cand mismatch!"
1555  << "\tdata: " << ndata
1556  << "\temul: " << nemul
1557  << std::endl;
1558  }
1559  col_it itd = data -> begin();
1560  col_it itm = emul -> begin();
1561  for (col_sz i=0; i<ndata; i++) {
1562  match &= dumpCandidate(*itd++,*itm++, m_dumpFile);
1563  }
1564  return match;
1565 }
int i
Definition: DBlmapReader.cc:9
uint16_t size_type
bool dumpCandidate(const T &dt, const T &em, std::ostream &s)
#define begin
Definition: vmac.h:31
std::ofstream m_dumpFile
Definition: L1Comparator.h:91
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
bool L1Comparator::compareFedRawCollections ( edm::Handle< FEDRawDataCollection data,
edm::Handle< FEDRawDataCollection emul,
int  fedid 
)
private

Definition at line 1509 of file L1Comparator.cc.

References gather_cfg::cout, FEDRawData::data(), createTree::dd, i, j, convertSQLiteXML::ok, FEDRawData::size(), and validate_alignment_devdb10_cfg::verbose.

1510  {
1511  if(verbose())
1512  std::cout << "[L1Comparator] fedraw start processing :" << std::endl << std::flush;
1513  if(dumpEvent_) {
1514  m_dumpFile << "\nEvent: " << nevt_ << std::endl;
1515  dumpEvent_=false;
1516  }
1517  m_dumpFile << "\n FEDRawData candidates...\n";
1518  const FEDRawData& raw_fed_data = data->FEDData(fedId);
1519  const FEDRawData& raw_fed_emul = emul->FEDData(fedId);
1520  bool raw_match=true;
1521  for(int i=0; i!=(int)raw_fed_data.size();i++) {
1522  raw_match &= ( raw_fed_data.data()[i] == raw_fed_emul.data()[i] );
1523  }
1524  unsigned long dd = 0, de = 0;
1525  for(int i=0; i<(int)raw_fed_data.size()/4;i++) {
1526  dd=0; de=0;
1527  for(int j=0; j<4; j++)
1528  dd += ((raw_fed_data.data()[i*4+j]&0xff)<<(8*j));
1529  for(int j=0; j<4; j++)
1530  de += ((raw_fed_emul.data()[i*4+j]&0xff)<<(8*j));
1531  if(m_dumpMode==-1 || (m_dumpMode==1 && dd!=de) ) {
1532  m_dumpFile << "\n\tdata: " << std::setw(8) << std::setfill('0') << std::hex << dd;
1533  m_dumpFile << "\n\temul: " << std::setw(8) << std::setfill('0') << std::hex << de;
1534  }
1535  m_dumpFile << std::endl;
1536  }
1537  char ok[10];
1538  if(raw_match) sprintf(ok,"successful");
1539  else sprintf(ok,"failed");
1540  m_dumpFile << " ...FEDRawData data and emulator comparison: "
1541  << ok << std::endl;
1542  return raw_match;
1543 }
int i
Definition: DBlmapReader.cc:9
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
int j
Definition: DBlmapReader.cc:9
std::ofstream m_dumpFile
Definition: L1Comparator.h:91
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
tuple cout
Definition: gather_cfg.py:41
template<class T >
bool L1Comparator::dumpCandidate ( const T dt,
const T em,
std::ostream &  s 
)
private

Definition at line 1568 of file L1Comparator.cc.

1568  {
1569  if(dt==em)
1570  return true;
1571  s<<dt<<std::endl;
1572  s<<em<<std::endl<<std::endl;
1573  return false;
1574 }
float dt
Definition: AMPTWrapper.h:126
string s
Definition: asciidump.py:422
void L1Comparator::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 200 of file L1Comparator.cc.

200  {
201  if(m_dumpMode)
202  m_dumpFile << "\n\n-------\n"
203  << "Global data|emulator agreement: "
204  << m_match << std::endl;
205  m_dumpFile.close();
206 }
std::ofstream m_dumpFile
Definition: L1Comparator.h:91
template<class T >
void L1Comparator::process ( T const *  data,
T const *  emul,
const int  sys,
const int  cid 
)
private

tmp: for getting a clean dump (avoid empty entries)

perform comparison

gather results

over-write system-id: needed eg for GMT input, CSC tf reg cand, CTP&CTF

over-write data type: needed eg for GCT jet types, regional muon sources

append d|e digis to the record's collection

Definition at line 962 of file L1Comparator.cc.

References gather_cfg::cout, DEcompare< T >::de_type(), DEcompare< T >::do_compare(), DEcompare< T >::get_ncand(), DEcompare< T >::getDEDigis(), DEcompare< T >::GetName(), i, DEcompare< T >::print(), dedefs::SystLabel, tmp, and validate_alignment_devdb10_cfg::verbose.

Referenced by process().

962  {
963 
964  if(verbose())
965  std::cout << "L1Comparator::process -ing system:" << sys
966  << " (" << SystLabel[sys] << "), data type " << cid
967  << "...\n" << std::flush;
968  if(verbose())
969  std::cout << "L1Comparator::process debug "
970  << " (size " << data->size() << "," <<emul->size() << ")"
971  << ".\n" << std::flush;
972 
974  bool prt = false;
975  if(!m_dumpMode)
976  prt = false;
977  else if(m_dumpMode==-1)
978  prt=true;
979  else if(m_dumpMode>0) {
980  DEcompare<T> tmp(data,emul);
981  if(tmp.get_ncand(0)==0 && tmp.get_ncand(1)==0)
982  prt=false;
983  else
984  prt = !tmp.do_compare(m_dumpFile,0);
985  }
986 
987  //declare de compare object
988  DEcompare<T> cmp(data,emul);
989 
990  int ndata = cmp.get_ncand(0);
991  int nemul = cmp.get_ncand(1);
992 
993  if(verbose())
994  std::cout << "L1Comparator::process "
995  << " system:" << SystLabel[sys] << "(id " << sys << ")"
996  << " type:" << cmp.GetName(0) << "(" << cmp.de_type() << ")"
997  << " ndata:" << ndata
998  << " nemul:" << nemul
999  << " (size " << data->size() << "," <<emul->size() << ")"
1000  << ".\n" << std::flush;
1001 
1002  if(ndata==0&&nemul==0) {
1003  if(verbose())
1004  std::cout << "L1Comparator::process "
1005  << "empty collections -- exiting!\n" << std::flush;
1006  return;
1007  }
1008 
1009  m_dumpFile << std::setiosflags(std::ios::showpoint | std::ios::fixed
1010  | std::ios::right | std::ios::adjustfield);
1011  std::cout << std::setiosflags(std::ios::showpoint | std::ios::fixed
1012  | std::ios::right | std::ios::adjustfield);
1013 
1014  if(dumpEvent_ && prt ) {
1015  m_dumpFile << "\nEntry: " << nevt_
1016  << " (event:" << evtNum_
1017  << " | run:" << runNum_
1018  << ")\n" << std::flush;
1019  dumpEvent_=false;
1020  }
1021 
1022  if(prt)
1023  m_dumpFile << "\n sys:" << SystLabel[sys]
1024  << " (" << sys << "), type:" << cid //cmp.GetName()
1025  << " ...\n";
1026 
1027  if(verbose())
1028  std::cout << "L1Comparator::process print:\n" << std::flush
1029  << cmp.print()
1030  << std::flush;
1031 
1033  DEmatchEvt[sys] &= cmp.do_compare(m_dumpFile,m_dumpMode);
1034 
1036  L1DEDigiCollection dg = cmp.getDEDigis();
1037 
1038  if(verbose())
1039  for(L1DEDigiCollection::iterator it=dg.begin(); it!=dg.end();it++)
1040  std::cout << *it << "\n";
1041 
1043  for(L1DEDigiCollection::iterator it=dg.begin(); it!=dg.end();it++)
1044  it->setSid(sys);
1046  for(L1DEDigiCollection::iterator it=dg.begin(); it!=dg.end();it++)
1047  it->setCid(cid);
1048 
1050  m_dedigis.insert(m_dedigis.end(), dg.begin(), dg.end());
1051  for(int i=0; i<2; i++)
1052  DEncand[sys][i] += cmp.get_ncand(i);
1053 
1054  if(verbose())
1055  std::cout << "L1Comparator::process "
1056  << " system:" << SystLabel[sys]
1057  << " type:" << cmp.GetName(0)
1058  << " ndata:" << DEncand[sys][0]
1059  << " nemul:" << DEncand[sys][1]
1060  << " (size " << data->size() << "," <<emul->size() << ")"
1061  << " ndigis:" << dg.size()
1062  << " agree? " << DEmatchEvt[sys]
1063  << std::endl;
1064 
1065  if(verbose())
1066  std::cout << "L1Comparator::process -ing system:"
1067  << sys << " (" << SystLabel[sys] << ")...done.\n"
1068  << std::flush;
1069 }
int i
Definition: DBlmapReader.cc:9
int DEncand[dedefs::DEnsys][2]
Definition: L1Comparator.h:95
std::vector< L1DataEmulDigi > L1DEDigiCollection
Definition: DEtrait.h:79
bool DEmatchEvt[dedefs::DEnsys]
Definition: L1Comparator.h:94
const std::string SystLabel[DEnsys]
Definition: DEtrait.h:45
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
L1DEDigiCollection m_dedigis
Definition: L1Comparator.h:96
std::ofstream m_dumpFile
Definition: L1Comparator.h:91
tuple cout
Definition: gather_cfg.py:41
template<class T >
void L1Comparator::process ( const edm::Handle< T data,
const edm::Handle< T emul,
const int  sys,
const int  cid 
)
inlineprivate

Definition at line 60 of file L1Comparator.h.

References edm::HandleBase::isValid(), process(), and edm::Handle< T >::product().

61  {
62  if(data.isValid()&&emul.isValid())
63  process(data.product(),emul.product(),sys, cid);
64  }
bool isValid() const
Definition: HandleBase.h:76
T const * product() const
Definition: Handle.h:74
void process(T const *, T const *, const int, const int)
void L1Comparator::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

– Get the data and emulated collections -----————————

place candidates into vectors

restrict comparison to middle of readout window

— done getting collections. —

processing : compare the pairs of collections

tmp: for getting a clean dump (avoid empty entries)

(may skip further collection checks temporarily...)

further analysis

Implements edm::EDProducer.

Definition at line 209 of file L1Comparator.cc.

References CSCALCTDigi::clear(), CSCCLCTDigi::clear(), edm::HandleBase::clear(), gather_cfg::cout, dedefs::CSCtf, dedefs::CSCtfsta, dedefs::CSCtftrk, dedefs::CSCtpa, dedefs::CSCtpc, dedefs::CSCtpl, dedefs::CTF, dedefs::CTP, dedefs::DEnsys, cond::rpcobgas::detid, dedefs::DTF, dedefs::DTP, dedefs::DTtf, dedefs::DTtftrk, dedefs::DTtpPh, dedefs::DTtpTh, dedefs::ECALtp, dedefs::ETP, edm::EventID::event(), spr::find(), dedefs::GCT, dedefs::GCTcenjets, dedefs::GCTethad, dedefs::GCTetmiss, dedefs::GCTettot, dedefs::GCTforjets, dedefs::GCThfbit, dedefs::GCThfring, dedefs::GCThtmiss, dedefs::GCTisolaem, dedefs::GCTnoisoem, dedefs::GCTtaujets, edm::Event::getByLabel(), dedefs::GLT, dedefs::GMT, dedefs::GMTcnd, dedefs::GMTmain, dedefs::GMTrdt, dedefs::HCALtp, dedefs::HTP, i, edm::EventBase::id(), edm::HandleBase::isValid(), j, label, dedefs::LTC, dedefs::LTCi, convertSQLiteXML::ok, edm::Event::put(), dedefs::RCT, dedefs::RCTem, dedefs::RCTrgn, record, dedefs::RPC, dedefs::RPCcen, dedefs::RPCfor, edm::EventID::run(), L1MuGMTCand::setPhiValue(), and validate_alignment_devdb10_cfg::verbose.

209  {
210 
211  nevt_++;
212  evtNum_ = iEvent.id().event();
213  runNum_ = iEvent.id().run();
214 
215  if(verbose())
216  std::cout << "\nL1COMPARATOR entry:" << nevt_ << " | evt:" << evtNum_
217  << " | run:" << runNum_ << "\n" << std::flush;
218 
219  //flag whether event id has already been written to dumpFile
220  dumpEvent_ = true;
221 
222  //reset event holder quantities
223  for(int i=0; i<DEnsys; i++) {
224  for(int j=0; j<2; j++)
225  DEncand[i][j] = 0;
226  DEmatchEvt[i] = true;
227  }
228  m_dedigis.clear();
229 
230 
232 
233  // -- ETP [electromagnetic calorimeter trigger primitives]
236  if(m_doSys[ETP]) {
237  iEvent.getByLabel(m_DEsource[ETP][0], ecal_tp_data);
238  iEvent.getByLabel(m_DEsource[ETP][1], ecal_tp_emul);
239  }
240 
241  // -- HTP [hadronic calorimeter trigger primitives]
244  if(m_doSys[HTP]) {
245  iEvent.getByLabel(m_DEsource[HTP][0], hcal_tp_data);
246  iEvent.getByLabel(m_DEsource[HTP][1], hcal_tp_emul);
247  }
248 
249  // -- RCT [regional calorimeter trigger]
254  if(m_doSys[RCT]) {
255  iEvent.getByLabel(m_DEsource[RCT][0], rct_em_data);
256  iEvent.getByLabel(m_DEsource[RCT][1], rct_em_emul);
257  iEvent.getByLabel(m_DEsource[RCT][0], rct_rgn_data);
258  iEvent.getByLabel(m_DEsource[RCT][1], rct_rgn_emul);
259  }
260 
261  // -- GCT [global calorimeter trigger]
262  edm::Handle<L1GctEmCandCollection> gct_isolaem_data;
263  edm::Handle<L1GctEmCandCollection> gct_isolaem_emul;
264  edm::Handle<L1GctEmCandCollection> gct_noisoem_data;
265  edm::Handle<L1GctEmCandCollection> gct_noisoem_emul;
266  edm::Handle<L1GctJetCandCollection> gct_cenjets_data;
267  edm::Handle<L1GctJetCandCollection> gct_cenjets_emul;
268  edm::Handle<L1GctJetCandCollection> gct_forjets_data;
269  edm::Handle<L1GctJetCandCollection> gct_forjets_emul;
270  edm::Handle<L1GctJetCandCollection> gct_taujets_data;
271  edm::Handle<L1GctJetCandCollection> gct_taujets_emul;
272 
275  edm::Handle<L1GctEtMissCollection> gct_etmiss_data;
276  edm::Handle<L1GctEtMissCollection> gct_etmiss_emul;
277  edm::Handle<L1GctEtTotalCollection> gct_ettota_data;
278  edm::Handle<L1GctEtTotalCollection> gct_ettota_emul;
279  edm::Handle<L1GctHtMissCollection> gct_htmiss_data;
280  edm::Handle<L1GctHtMissCollection> gct_htmiss_emul;
285  edm::Handle<L1GctJetCountsCollection> gct_jetcnt_data;
287 
288  if(m_doSys[GCT]) {
289  iEvent.getByLabel(m_DEsource[GCT][0].label(),"isoEm", gct_isolaem_data);
290  iEvent.getByLabel(m_DEsource[GCT][1].label(),"isoEm", gct_isolaem_emul);
291  iEvent.getByLabel(m_DEsource[GCT][0].label(),"nonIsoEm",gct_noisoem_data);
292  iEvent.getByLabel(m_DEsource[GCT][1].label(),"nonIsoEm",gct_noisoem_emul);
293  iEvent.getByLabel(m_DEsource[GCT][0].label(),"cenJets", gct_cenjets_data);
294  iEvent.getByLabel(m_DEsource[GCT][1].label(),"cenJets", gct_cenjets_emul);
295  iEvent.getByLabel(m_DEsource[GCT][0].label(),"forJets", gct_forjets_data);
296  iEvent.getByLabel(m_DEsource[GCT][1].label(),"forJets", gct_forjets_emul);
297  iEvent.getByLabel(m_DEsource[GCT][0].label(),"tauJets", gct_taujets_data);
298  iEvent.getByLabel(m_DEsource[GCT][1].label(),"tauJets", gct_taujets_emul);
299 
300  iEvent.getByLabel(m_DEsource[GCT][0],gct_ht_data);
301  iEvent.getByLabel(m_DEsource[GCT][1],gct_ht_emul);
302  iEvent.getByLabel(m_DEsource[GCT][0],gct_etmiss_data);
303  iEvent.getByLabel(m_DEsource[GCT][1],gct_etmiss_emul);
304  iEvent.getByLabel(m_DEsource[GCT][0],gct_ettota_data);
305  iEvent.getByLabel(m_DEsource[GCT][1],gct_ettota_emul);
306  iEvent.getByLabel(m_DEsource[GCT][0],gct_htmiss_data);
307  iEvent.getByLabel(m_DEsource[GCT][1],gct_htmiss_emul);
308  iEvent.getByLabel(m_DEsource[GCT][0],gct_hfring_data);
309  iEvent.getByLabel(m_DEsource[GCT][1],gct_hfring_emul);
310  iEvent.getByLabel(m_DEsource[GCT][0],gct_hfbcnt_data);
311  iEvent.getByLabel(m_DEsource[GCT][1],gct_hfbcnt_emul);
312  iEvent.getByLabel(m_DEsource[GCT][0],gct_jetcnt_data);
313  iEvent.getByLabel(m_DEsource[GCT][1],gct_jetcnt_emul);
314  }
315 
316  // -- DTP [drift tube trigger primitive]
321  if(m_doSys[DTP]) {
322  iEvent.getByLabel(m_DEsource[DTP][0],dtp_ph_data_);
323  iEvent.getByLabel(m_DEsource[DTP][1],dtp_ph_emul_);
324  iEvent.getByLabel(m_DEsource[DTP][0],dtp_th_data_);
325  iEvent.getByLabel(m_DEsource[DTP][1],dtp_th_emul_);
326  }
327  L1MuDTChambPhDigiCollection const* dtp_ph_data = 0;
328  L1MuDTChambPhDigiCollection const* dtp_ph_emul = 0;
329  L1MuDTChambThDigiCollection const* dtp_th_data = 0;
330  L1MuDTChambThDigiCollection const* dtp_th_emul = 0;
331 
332  if(dtp_ph_data_.isValid()) dtp_ph_data = dtp_ph_data_->getContainer();
333  if(dtp_ph_emul_.isValid()) dtp_ph_emul = dtp_ph_emul_->getContainer();
334  if(dtp_th_data_.isValid()) dtp_th_data = dtp_th_data_->getContainer();
335  if(dtp_th_emul_.isValid()) dtp_th_emul = dtp_th_emul_->getContainer();
336 
337  // -- DTF [drift tube track finder]
340  edm::Handle<L1MuDTTrackContainer> dtf_trk_data_;
341  edm::Handle<L1MuDTTrackContainer> dtf_trk_emul_;
342  L1MuRegionalCandCollection const* dtf_trk_data = 0;
343  L1MuRegionalCandCollection const* dtf_trk_emul = 0;
344  if(m_doSys[DTF]) {
345  iEvent.getByLabel(m_DEsource[DTF][0].label(),"DT",dtf_data);
346  iEvent.getByLabel(m_DEsource[DTF][1].label(),"DT",dtf_emul);
347  //iEvent.getByLabel(m_DEsource[DTF][0].label(),"DTTF",dtf_trk_data_);
348  iEvent.getByLabel(m_DEsource[DTF][0].label(),"DATA",dtf_trk_data_);
349  iEvent.getByLabel(m_DEsource[DTF][1].label(),"DTTF",dtf_trk_emul_);
350  }
351  //extract the regional cands
352  typedef std::vector<L1MuDTTrackCand> L1MuDTTrackCandCollection;
353  L1MuRegionalCandCollection dtf_trk_data_v, dtf_trk_emul_v;
354  dtf_trk_data_v.clear(); dtf_trk_emul_v.clear();
355  if(dtf_trk_data_.isValid()) {
356  L1MuDTTrackCandCollection *dttc = dtf_trk_data_->getContainer();
357  for(L1MuDTTrackCandCollection::const_iterator it=dttc->begin();
358  it!=dttc->end(); it++)
359  dtf_trk_data_v.push_back(L1MuRegionalCand(*it));
360  }
361  if(dtf_trk_emul_.isValid()) {
362  L1MuDTTrackCandCollection *dttc = dtf_trk_emul_->getContainer();
363  for(L1MuDTTrackCandCollection::const_iterator it=dttc->begin();
364  it!=dttc->end(); it++)
365  dtf_trk_emul_v.push_back(L1MuRegionalCand(*it));
366  }
367  dtf_trk_data =&dtf_trk_data_v;
368  dtf_trk_emul =&dtf_trk_emul_v;
369 
370  // -- CTP [cathode strip chamber trigger primitive]
377  CSCALCTDigiCollection_ const* ctp_ano_data = 0;
378  CSCALCTDigiCollection_ const* ctp_ano_emul = 0;
379  CSCCLCTDigiCollection_ const* ctp_cat_data = 0;
380  CSCCLCTDigiCollection_ const* ctp_cat_emul = 0;
381  CSCCorrelatedLCTDigiCollection_ const* ctp_lct_data = 0;
382  CSCCorrelatedLCTDigiCollection_ const* ctp_lct_emul = 0;
383  if(m_doSys[CTP]) {
384  if(m_DEsource[CTP][0].label().find("tf")!=std::string::npos) {
385  //if correlated LCTs from TF, read needed info from TP data digis
386  iEvent.getByLabel("muonCSCDigis", "MuonCSCALCTDigi" ,ctp_ano_data_);
387  iEvent.getByLabel("muonCSCDigis", "MuonCSCCLCTDigi" ,ctp_cat_data_);
388  iEvent.getByLabel(m_DEsource[CTP][0] ,ctp_lct_data_);
389  } else {
390  iEvent.getByLabel(m_DEsource[CTP][0].label(),"MuonCSCALCTDigi",ctp_ano_data_);
391  iEvent.getByLabel(m_DEsource[CTP][0].label(),"MuonCSCCLCTDigi",ctp_cat_data_);
392  iEvent.getByLabel(m_DEsource[CTP][0].label(),"MuonCSCCorrelatedLCTDigi",ctp_lct_data_);
393  }
394  iEvent.getByLabel(m_DEsource[CTP][1] ,ctp_ano_emul_);
395  iEvent.getByLabel(m_DEsource[CTP][1] ,ctp_cat_emul_);
396  iEvent.getByLabel(m_DEsource[CTP][1] ,ctp_lct_emul_);
397  }
398 
400  //Anode LCT
401  CSCALCTDigiCollection_ ctp_ano_data_v, ctp_ano_emul_v;
402  ctp_ano_data_v.clear(); ctp_ano_emul_v.clear();
403  if(ctp_ano_data_.isValid() && ctp_ano_emul_.isValid()) {
404  // The following numbers should come from config. database eventually...
405  int fifo_pretrig = 10;
406  int fpga_latency = 6;
407  int l1a_window_width = 7;
408  // Time offset of raw hits w.r.t. the full 12-bit BXN.
409  int rawhit_tbin_offset =
410  (fifo_pretrig - fpga_latency) + (l1a_window_width-1)/2;
411  // Extra difference due to additional register stages; determined
412  // empirically.
413  int register_delay = 2;
416  for (mapIt mit = ctp_ano_data_->begin(); mit != ctp_ano_data_->end(); mit++)
417  for (vecIt vit = ctp_ano_data_->get((*mit).first).first;
418  vit != ctp_ano_data_->get((*mit).first).second; vit++)
419  ctp_ano_data_v.push_back(*vit);
420  for (mapIt mit = ctp_ano_emul_->begin(); mit != ctp_ano_emul_->end(); mit++)
421  for (vecIt vit = ctp_ano_emul_->get((*mit).first).first;
422  vit != ctp_ano_emul_->get((*mit).first).second; vit++) {
423  int emul_bx_corr =
424  (*vit).getBX() - rawhit_tbin_offset + register_delay;
425  CSCALCTDigi alct((*vit).isValid(), (*vit).getQuality(),
426  (*vit).getAccelerator(), (*vit).getCollisionB(),
427  (*vit).getKeyWG(), emul_bx_corr,
428  (*vit).getTrknmb());
429  ctp_ano_emul_v.push_back(alct);
430  }
431  }
432  ctp_ano_data =&ctp_ano_data_v;
433  ctp_ano_emul =&ctp_ano_emul_v;
434  //Cathode LCT
435  CSCCLCTDigiCollection_ ctp_cat_data_v, ctp_cat_emul_v;
436  ctp_cat_data_v.clear(); ctp_cat_emul_v.clear();
437  if(ctp_cat_data_.isValid() && ctp_cat_emul_.isValid()) {
438  int tbin_cathode_offset = 7, emul_bx_corr;
441  for (mapIt mit = ctp_cat_data_->begin(); mit != ctp_cat_data_->end(); mit++)
442  for (vecIt vit = ctp_cat_data_->get((*mit).first).first;
443  vit != ctp_cat_data_->get((*mit).first).second; vit++)
444  ctp_cat_data_v.push_back(*vit);
445  for (mapIt mit = ctp_cat_emul_->begin(); mit != ctp_cat_emul_->end(); mit++) {
446  const CSCDetId& detid = (*mit).first;
447 
448  // Extract full 12-bit BX word from CLCT data collections.
449  int full_cathode_bx = -999;
450  const CSCCLCTDigiCollection::Range& crange = ctp_cat_data_->get(detid);
451  for (vecIt digiIt = crange.first; digiIt != crange.second; digiIt++) {
452  if ((*digiIt).isValid()) {
453  full_cathode_bx = (*digiIt).getFullBX();
454  break;
455  }
456  }
457 
458  for (vecIt vit = ctp_cat_emul_->get(detid).first;
459  vit != ctp_cat_emul_->get(detid).second; vit++) {
460  int emul_bx = (*vit).getBX();
461  if (full_cathode_bx != -999)
462  emul_bx_corr =
463  (full_cathode_bx + emul_bx - tbin_cathode_offset) & 0x03;
464  else
465  emul_bx_corr = emul_bx & 0x03;
466  CSCCLCTDigi clct((*vit).isValid(), (*vit).getQuality(),
467  (*vit).getPattern(), (*vit).getStripType(),
468  (*vit).getBend(), (*vit).getStrip(),
469  (*vit).getCFEB(), emul_bx_corr,
470  (*vit).getTrknmb());
471  ctp_cat_emul_v.push_back(clct);
472  }
473  }
474  }
475  ctp_cat_data =&ctp_cat_data_v;
476  ctp_cat_emul =&ctp_cat_emul_v;
477  //Correlated (anode+cathode) LCTs
478  CSCCorrelatedLCTDigiCollection_ ctp_lct_data_v, ctp_lct_emul_v;
479  ctp_lct_data_v.clear(); ctp_lct_emul_v.clear();
480  if(ctp_lct_data_.isValid() && ctp_lct_emul_.isValid()) {
481  int tbin_anode_offset = 5, emul_bx_corr;
482  typedef CSCCorrelatedLCTDigiCollection::DigiRangeIterator mapIt;//map iterator
483  typedef CSCCorrelatedLCTDigiCollection::const_iterator vecIt;//vec iterator
484  //loop over data (map<idx,vec_digi>)
485  for (mapIt mit = ctp_lct_data_->begin(); mit != ctp_lct_data_->end(); mit++)
486  //get vec_digi range(pair) corresponding to idx of map
487  //loop over digi vector (ie between begin and end pointers in range)
488  //CSCCorrelatedLCTDigiCollection::Range ctpRange = ctp_lct_data_->get((*mit).first)
489  //for (vecIt vit = ctpRange.first; vit != ctpRange.second; vit++) {
490  for (vecIt vit = ctp_lct_data_->get((*mit).first).first;
491  vit != ctp_lct_data_->get((*mit).first).second; vit++)
492  ctp_lct_data_v.push_back(*vit);
493  for (mapIt mit = ctp_lct_emul_->begin(); mit != ctp_lct_emul_->end(); mit++) {
494  const CSCDetId& detid = (*mit).first;
495 
496  // Extract full 12-bit BX word from ALCT data collections.
497  int full_anode_bx = -999;
498  if(ctp_ano_data_.isValid()) {
499  const CSCALCTDigiCollection::Range& arange = ctp_ano_data_->get(detid);
500  for (CSCALCTDigiCollection::const_iterator digiIt = arange.first;
501  digiIt != arange.second; digiIt++) {
502  if ((*digiIt).isValid()) {
503  full_anode_bx = (*digiIt).getFullBX();
504  break;
505  }
506  }
507  }
508 
509  for (vecIt vit = ctp_lct_emul_->get(detid).first;
510  vit != ctp_lct_emul_->get(detid).second; vit++) {
511  int emul_bx = (*vit).getBX();
512  if (full_anode_bx != -999) {
513  emul_bx_corr = (full_anode_bx + emul_bx - tbin_anode_offset) & 0x01;
514  }
515  else { // This should never happen for default config. settings.
516  emul_bx_corr = emul_bx & 0x01;
517  }
518 
519  // If one compares correlated LCTs after the muon port card, an
520  // additional offset is needed.
521  if (m_DEsource[CTP][1].instance() == "MPCSORTED") emul_bx_corr += 5;
522 
523  CSCCorrelatedLCTDigi lct((*vit).getTrknmb(), (*vit).isValid(),
524  (*vit).getQuality(), (*vit).getKeyWG(),
525  (*vit).getStrip(), (*vit).getPattern(),
526  (*vit).getBend(), emul_bx_corr,
527  (*vit).getMPCLink(), (*vit).getBX0(),
528  (*vit).getSyncErr(), (*vit).getCSCID());
529  ctp_lct_emul_v.push_back(lct);
530  }
531  }
532  }
533  ctp_lct_data =&ctp_lct_data_v;
534  ctp_lct_emul =&ctp_lct_emul_v;
535 
536 
537  // -- CTF [cathode strip chamber track finder]
538  edm::Handle<L1MuRegionalCandCollection> ctf_data, ctf_emul;
539  edm::Handle<L1CSCTrackCollection> ctf_trk_data_, ctf_trk_emul_;
548  if(m_doSys[CTF]) {
549  iEvent.getByLabel(m_DEsource[CTF][2],ctf_trk_data_);
550  iEvent.getByLabel(m_DEsource[CTF][3],ctf_trk_emul_);
551  //note: unpacker different label: MounL1CSCTrackCollection
552  iEvent.getByLabel(m_DEsource[CTF][0],ctf_data);
553  iEvent.getByLabel(m_DEsource[CTF][1],ctf_emul);
554  //note: unpacker only
555  iEvent.getByLabel(m_DEsource[CTF][0].label(),"MuonL1CSCStatusDigiCollection",ctf_sta_data_);
556  iEvent.getByLabel(m_DEsource[CTF][1].label(),"MuonL1CSCStatusDigiCollection",ctf_sta_emul_);
557  }
558  if(ctf_sta_data_.isValid())
559  ctf_sta_data = &(ctf_sta_data_->second);
560  if(ctf_sta_emul_.isValid())
561  ctf_sta_emul = &(ctf_sta_emul_->second);
562  if(ctf_trk_data_.isValid() && ctf_trk_emul_.isValid()) {
563  typedef CSCCorrelatedLCTDigiCollection::DigiRangeIterator mapIt;//map iterator
564  typedef CSCCorrelatedLCTDigiCollection::const_iterator vecIt;//vec iterator
565  CSCCorrelatedLCTDigiCollection_ ctf_trk_data_v, ctf_trk_emul_v; //vector
566  L1MuRegionalCandCollection ctf_trc_data_v, ctf_trc_emul_v; //vector
567  typedef L1CSCTrackCollection::const_iterator ctcIt;
568  //loop over csc-tracks (ie pairs<l1track,digi_vec>)
569  for(ctcIt tcit=ctf_trk_data_->begin(); tcit!=ctf_trk_data_->end(); tcit++) {
571  if((tcit->first.bx() < -1) || (tcit->first.bx() > 1))
572  continue;
573  //store the muon candidate
574  //csc::L1Track ttr = tcit->first;
575  //L1MuRegionalCand cand(ttr);
576  //ctf_trc_data_v.push_back(tcit->first);
577  ctf_trc_data_v.push_back(L1MuRegionalCand(tcit->first.getDataWord(), tcit->first.bx()));
578  CSCCorrelatedLCTDigiCollection ldc = tcit->second; //muondigicollection=map
579  //get the lct-digi-collection (ie muon-digi-collection)
580  //loop over data (map<idx,vec_digi>)
581  for (mapIt mit = ldc.begin(); mit != ldc.end(); mit++)
582  //get vec_digi range(pair) corresponding to idx of map
583  //loop over digi vector (ie between begin and end pointers in range)
584  //CSCCorrelatedLCTDigiCollection::Range ctpRange = ctp_lct_data_->get((*mit).first)
585  //for (vecIt vit = ctpRange.first; vit != ctpRange.second; vit++) {
586  for (vecIt vit = ldc.get((*mit).first).first;
587  vit != ldc.get((*mit).first).second; vit++)
588  ctf_trk_data_v.push_back(*vit);
589  }
590  ctf_trk_data = &ctf_trk_data_v;
591  ctf_trc_data = &ctf_trc_data_v;
592  //same for emulator collection
593  for(ctcIt tcit=ctf_trk_emul_->begin();tcit!=ctf_trk_emul_->end(); tcit++) {
594  if((tcit->first.bx() < -1) || (tcit->first.bx() > 1))
595  continue;
596  ctf_trc_emul_v.push_back(L1MuRegionalCand(tcit->first.getDataWord(), tcit->first.bx()));
597  CSCCorrelatedLCTDigiCollection ldc = tcit->second;
598  for (mapIt mit = ldc.begin(); mit != ldc.end(); mit++)
599  for (vecIt vit = ldc.get((*mit).first).first;
600  vit != ldc.get((*mit).first).second; vit++)
601  ctf_trk_emul_v.push_back(*vit);
602  }
603  ctf_trk_emul = &ctf_trk_emul_v;
604  ctf_trc_emul = &ctf_trc_emul_v;
605  }
606 
607  // -- RPC [resistive plate chambers regional trigger]
612  if(m_doSys[RPC]) {
613  iEvent.getByLabel(m_DEsource[RPC][0].label(),"RPCb",rpc_cen_data);
614  iEvent.getByLabel(m_DEsource[RPC][1].label(),"RPCb",rpc_cen_emul);
615  iEvent.getByLabel(m_DEsource[RPC][0].label(),"RPCf",rpc_for_data);
616  iEvent.getByLabel(m_DEsource[RPC][1].label(),"RPCf",rpc_for_emul);
617  }
618 
619  // -- LTC [local trigger controller]
622  if(m_doSys[LTC]) {
623  iEvent.getByLabel(m_DEsource[LTC][0],ltc_data);
624  iEvent.getByLabel(m_DEsource[LTC][1],ltc_emul);
625  }
626 
627  // -- GMT [global muon trigger]
634  //tbd: may compare extended candidates
635  L1MuGMTCandCollection const *gmt_can_data(new L1MuGMTCandCollection);
636  L1MuGMTCandCollection const *gmt_can_emul(new L1MuGMTCandCollection);
637  if(m_doSys[GMT]) {
638  iEvent.getByLabel(m_DEsource[GMT][0], gmt_data);
639  iEvent.getByLabel(m_DEsource[GMT][1], gmt_emul);
640  iEvent.getByLabel(m_DEsource[GMT][0], gmt_rdt_data_);
641  iEvent.getByLabel(m_DEsource[GMT][1], gmt_rdt_emul_);
642  }
643  L1MuGMTCandCollection gmt_can_data_vec, gmt_can_emul_vec;
644  L1MuRegionalCandCollection gmt_rdt_data_vec, gmt_rdt_emul_vec;
645  gmt_can_data_vec.clear(); gmt_can_emul_vec.clear();
646  gmt_rdt_data_vec.clear(); gmt_rdt_emul_vec.clear();
647  if( gmt_rdt_data_.isValid() && gmt_rdt_emul_.isValid() ) {
648  typedef std::vector<L1MuGMTReadoutRecord>::const_iterator GmtRrIt;
649  //get record vector for data
650  std::vector<L1MuGMTReadoutRecord> gmt_rdt_data_bx = gmt_rdt_data_->getRecords();
651  for(GmtRrIt igmtrr=gmt_rdt_data_bx.begin(); igmtrr!=gmt_rdt_data_bx.end(); igmtrr++) {
652  //get gmt cands
653  typedef std::vector<L1MuGMTExtendedCand>::const_iterator GmtECIt;
654  std::vector<L1MuGMTExtendedCand> gmc;
655  gmc = igmtrr->getGMTCands();
656  for(GmtECIt iter1=gmc.begin(); iter1!=gmc.end(); iter1++) {
657  L1MuGMTCand cand(iter1->getDataWord(),iter1->bx());
658  cand.setPhiValue(iter1->phiValue());
659  cand.setEtaValue(iter1->etaValue());
660  cand.setPtValue (iter1->ptValue ());
661  gmt_can_data_vec.push_back(cand);
662  }
663  //get reg cands
664  typedef L1MuRegionalCandCollection::const_iterator GmtRCIt;
666  rmc.clear();
667  rmc = igmtrr->getDTBXCands();
668  gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
669  rmc.clear();
670  rmc = igmtrr->getCSCCands();
671  gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
672  rmc.clear();
673  rmc = igmtrr->getBrlRPCCands();
674  gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
675  rmc.clear();
676  rmc = igmtrr->getFwdRPCCands();
677  gmt_rdt_data_vec.insert(gmt_rdt_data_vec.end(),rmc.begin(),rmc.end());
678  }
679  //get record vector for emul
680  std::vector<L1MuGMTReadoutRecord> gmt_rdt_emul_bx = gmt_rdt_emul_->getRecords();
681  for(GmtRrIt igmtrr=gmt_rdt_emul_bx.begin(); igmtrr!=gmt_rdt_emul_bx.end(); igmtrr++) {
682  //get gmt cands
683  typedef std::vector<L1MuGMTExtendedCand>::const_iterator GmtECIt;
684  std::vector<L1MuGMTExtendedCand> gmc;
685  gmc = igmtrr->getGMTCands();
686  for(GmtECIt iter1=gmc.begin(); iter1!=gmc.end(); iter1++) {
687  gmt_can_emul_vec.push_back(L1MuGMTCand(iter1->getDataWord(),iter1->bx()));
688  }
689  //get reg cands
690  typedef L1MuRegionalCandCollection::const_iterator GmtRCIt;
692  rmc.clear();
693  rmc = igmtrr->getDTBXCands();
694  gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
695  rmc.clear();
696  rmc = igmtrr->getCSCCands();
697  gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
698  rmc.clear();
699  rmc = igmtrr->getBrlRPCCands();
700  gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
701  rmc.clear();
702  rmc = igmtrr->getFwdRPCCands();
703  gmt_rdt_emul_vec.insert(gmt_rdt_emul_vec.end(),rmc.begin(),rmc.end());
704  }
705  }
706  gmt_rdt_data = &gmt_rdt_data_vec;
707  gmt_rdt_emul = &gmt_rdt_emul_vec;
708  gmt_can_data = &gmt_can_data_vec;
709  gmt_can_emul = &gmt_can_emul_vec;
710 
711  // -- GLT [global trigger]
718  if(m_doSys[GLT]) {
719  iEvent.getByLabel(m_DEsource[GLT][0], glt_rdt_data);
720  iEvent.getByLabel(m_DEsource[GLT][1], glt_rdt_emul);
721  iEvent.getByLabel(m_DEsource[GLT][0], glt_evm_data);
722  iEvent.getByLabel(m_DEsource[GLT][1], glt_evm_emul);
723  iEvent.getByLabel(m_DEsource[GLT][0], glt_obj_data);
724  iEvent.getByLabel(m_DEsource[GLT][1], glt_obj_emul);
725  }
726 
728 
729  //check collections validity
730  bool isValidDE[DEnsys][2];// = {false};
731  for(int i=0; i<DEnsys; i++) for(int j=0; j<2; j++) isValidDE[i][j]=false;
732 
733  isValidDE[ETP][0] = ecal_tp_data .isValid(); isValidDE[ETP][1] = ecal_tp_emul .isValid();
734  isValidDE[HTP][0] = hcal_tp_data .isValid(); isValidDE[HTP][1] = hcal_tp_emul .isValid();
735  isValidDE[RCT][0] = rct_em_data .isValid(); isValidDE[RCT][1] = rct_em_emul .isValid();
736  isValidDE[RCT][0]&= rct_rgn_data .isValid(); isValidDE[RCT][1] = rct_rgn_emul .isValid();
737  isValidDE[GCT][0] = gct_isolaem_data .isValid(); isValidDE[GCT][1] =gct_isolaem_emul .isValid();
738  isValidDE[GCT][0]&= gct_noisoem_data .isValid(); isValidDE[GCT][1]&=gct_noisoem_emul .isValid();
739  isValidDE[GCT][0]&= gct_cenjets_data .isValid(); isValidDE[GCT][1]&=gct_cenjets_emul .isValid();
740  isValidDE[GCT][0]&= gct_forjets_data .isValid(); isValidDE[GCT][1]&=gct_forjets_emul .isValid();
741  isValidDE[GCT][0]&= gct_taujets_data .isValid(); isValidDE[GCT][1]&=gct_taujets_emul .isValid();
742  isValidDE[GCT][0]&= gct_etmiss_data .isValid(); isValidDE[GCT][1]&= gct_etmiss_emul .isValid();
743  isValidDE[GCT][0]&= gct_ettota_data .isValid(); isValidDE[GCT][1]&= gct_ettota_emul .isValid();
744  isValidDE[GCT][0]&= gct_htmiss_data .isValid(); isValidDE[GCT][1]&= gct_htmiss_emul .isValid();
745  isValidDE[GCT][0]&= gct_hfring_data .isValid(); isValidDE[GCT][1]&= gct_hfring_emul .isValid();
746  isValidDE[GCT][0]&= gct_hfbcnt_data .isValid(); isValidDE[GCT][1]&= gct_hfbcnt_emul .isValid();
747 //isValidDE[GCT][0]&= gct_jetcnt_data .isValid(); isValidDE[GCT][1]&= gct_jetcnt_emul .isValid(); #temporary
748  isValidDE[DTP][0] = dtp_ph_data_.isValid(); isValidDE[DTP][1] = dtp_ph_emul_.isValid();
749  isValidDE[DTP][0]&= dtp_th_data_.isValid(); isValidDE[DTP][1]&= dtp_th_emul_.isValid();
750  isValidDE[DTF][0] = dtf_trk_data_.isValid(); isValidDE[DTF][1] = dtf_trk_emul_.isValid();
751 //isValidDE[DTF][0]&= dtf_data .isValid(); isValidDE[DTF][1]&= dtf_emul .isValid();
752  isValidDE[CTP][0] = ctp_lct_data_.isValid(); isValidDE[CTP][1] = ctp_lct_emul_.isValid();
753  if (m_DEsource[CTP][0].label().find("tf") == std::string::npos) {
754  isValidDE[CTP][0]&= ctp_ano_data_.isValid(); isValidDE[CTP][1]&= ctp_ano_emul_.isValid();
755  isValidDE[CTP][0]&= ctp_cat_data_.isValid(); isValidDE[CTP][1]&= ctp_cat_emul_.isValid();
756  }
757  isValidDE[CTF][0] = ctf_data .isValid(); isValidDE[CTF][1] = ctf_emul .isValid();
758  isValidDE[CTF][0]&= ctf_trk_data_ .isValid(); isValidDE[CTF][1]&= ctf_trk_emul_ .isValid();
759  //isValidDE[CTF][0]&= ctf_sta_data_ .isValid(); isValidDE[CTF][1]&= ctf_sta_emul_ .isValid();
760  isValidDE[RPC][0] = rpc_cen_data .isValid(); isValidDE[RPC][1] = rpc_cen_emul .isValid();
761  isValidDE[RPC][0]&= rpc_for_data .isValid(); isValidDE[RPC][1]&= rpc_for_emul .isValid();
762  isValidDE[LTC][0] = ltc_data .isValid(); isValidDE[LTC][1] = ltc_emul .isValid();
763  isValidDE[GMT][0] = gmt_data .isValid(); isValidDE[GMT][1] = gmt_emul .isValid();
764 //isValidDE[GMT][0]&= gmt_rdt_data_.isValid(); isValidDE[GMT][1]&= gmt_rdt_emul_.isValid();
765  isValidDE[GLT][0] = glt_rdt_data .isValid(); isValidDE[GLT][1] = glt_rdt_emul .isValid();
766 //isValidDE[GLT][0]&= glt_evm_data .isValid(); isValidDE[GLT][1]&= glt_evm_emul .isValid();
767 //isValidDE[GLT][0]&= glt_obj_data .isValid(); isValidDE[GLT][1]&= glt_obj_emul .isValid();
768 
769  bool isValid[DEnsys];
770  for(int i=0; i<DEnsys; i++) {
771  isValid[i]=true;
772  for(int j=0; j<2; j++) {
773  isValid[i] &= isValidDE[i][j];
774  }
775  }
776 
777  if(verbose()) {
778  std::cout << "L1Comparator sys isValid? (evt:" << nevt_ << ") ";
779  std::cout << "\n\t&: ";
780  for(int i=0; i<DEnsys; i++)
781  std::cout << isValid[i] << " ";
782  std::cout << "\n\td: ";
783  for(int i=0; i<DEnsys; i++)
784  std::cout << isValidDE[i][0] << " ";
785  std::cout << "\n\te: ";
786  for(int i=0; i<DEnsys; i++)
787  std::cout << isValidDE[i][1] << " ";
788  std::cout << std::endl;
789  }
790 
791  //reset flags...
792  //for(int i=0; i<DEnsys; i++) isValid[i]=true;
793 
794  if(verbose())
795  std::cout << "L1Comparator start processing the collections.\n" << std::flush;
796 
798  if(m_doSys[ETP]&&isValid[ETP]) process<EcalTrigPrimDigiCollection> ( ecal_tp_data, ecal_tp_emul, ETP,ECALtp);
799  if(m_doSys[HTP]&&isValid[HTP]) process<HcalTrigPrimDigiCollection> ( hcal_tp_data, hcal_tp_emul, HTP,HCALtp);
800  if(m_doSys[RCT]&&isValid[RCT]) process<L1CaloEmCollection> ( rct_em_data, rct_em_emul, RCT,RCTem);
801  if(m_doSys[RCT]&&isValid[RCT]) process<L1CaloRegionCollection> ( rct_rgn_data, rct_rgn_emul, RCT,RCTrgn);
802  if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEmCandCollection> (gct_isolaem_data, gct_isolaem_emul, GCT,GCTisolaem);
803  if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEmCandCollection> (gct_noisoem_data, gct_noisoem_emul, GCT,GCTnoisoem);
804  if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_cenjets_data, gct_cenjets_emul, GCT,GCTcenjets);
805  if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_forjets_data, gct_forjets_emul, GCT,GCTforjets);
806  if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCandCollection> (gct_taujets_data, gct_taujets_emul, GCT,GCTtaujets);
807  if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtHadCollection> ( gct_ht_data, gct_ht_emul, GCT,GCTethad);
808  if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtMissCollection> ( gct_etmiss_data, gct_etmiss_emul, GCT,GCTetmiss);
809  if(m_doSys[GCT]&&isValid[GCT]) process<L1GctEtTotalCollection> ( gct_ettota_data , gct_ettota_emul, GCT,GCTettot);
810  if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHtMissCollection> ( gct_htmiss_data, gct_htmiss_emul, GCT,GCThtmiss);
811  if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHFRingEtSumsCollection> ( gct_hfring_data, gct_hfring_emul, GCT,GCThfring);
812  if(m_doSys[GCT]&&isValid[GCT]) process<L1GctHFBitCountsCollection> ( gct_hfbcnt_data, gct_hfbcnt_emul, GCT,GCThfbit);
813 //if(m_doSys[GCT]&&isValid[GCT]) process<L1GctJetCountsCollection> ( gct_jetcnt_data, gct_jetcnt_emul, GCT,GCTjetcnt);#missing in emulator
814  if(m_doSys[DTP]&&isValid[DTP]) process<L1MuDTChambPhDigiCollection> ( dtp_ph_data, dtp_ph_emul, DTP,DTtpPh);
815  if(m_doSys[DTP]&&isValid[DTP]) process<L1MuDTChambThDigiCollection> ( dtp_th_data, dtp_th_emul, DTP,DTtpTh);
816  if(m_doSys[DTF]&&isValid[DTF]) process<L1MuRegionalCandCollection> ( dtf_data, dtf_emul, DTF,DTtf);
817  if(m_doSys[DTF]&&isValid[DTF]) process<L1MuRegionalCandCollection> ( dtf_trk_data, dtf_trk_emul, DTF,DTtftrk);
818  if(m_DEsource[CTP][0].label().find("tf") == std::string::npos) {
819  if(m_doSys[CTP]&&isValid[CTP]) process<CSCALCTDigiCollection_> ( ctp_ano_data, ctp_ano_emul, CTP,CSCtpa);
820  if(m_doSys[CTP]&&isValid[CTP]) process<CSCCLCTDigiCollection_> ( ctp_cat_data, ctp_cat_emul, CTP,CSCtpc);
821  }
822  if(m_doSys[CTP]&&isValid[CTP]) process<CSCCorrelatedLCTDigiCollection_>( ctp_lct_data, ctp_lct_emul, CTP,CSCtpl);
823  if(m_doSys[CTF]&&isValid[CTF]) process<L1MuRegionalCandCollection> ( ctf_data, ctf_emul, CTF,CSCtf);
824  if(m_doSys[CTF]&&isValid[CTF]) process<CSCCorrelatedLCTDigiCollection_>( ctf_trk_data, ctf_trk_emul, CTF,CSCtftrk);
825  //if(m_doSys[CTF]&&isValid[CTF]) process<L1MuRegionalCandCollection> ( ctf_trc_data, ctf_trc_emul, CTF,CSCtftrc);
826  if(m_doSys[CTF]&&isValid[CTF]) process<L1CSCSPStatusDigiCollection_> ( ctf_sta_data, ctf_sta_emul, CTF,CSCtfsta);
827  if(m_doSys[RPC]&&isValid[RPC]) process<L1MuRegionalCandCollection> ( rpc_cen_data, rpc_cen_emul, RPC,RPCcen);
828  if(m_doSys[RPC]&&isValid[RPC]) process<L1MuRegionalCandCollection> ( rpc_for_data, rpc_for_emul, RPC,RPCfor);
829  if(m_doSys[LTC]&&isValid[LTC]) process<LTCDigiCollection> ( ltc_data, ltc_emul, LTC,LTCi);
830  if(m_doSys[GMT]&&isValid[GMT]) process<L1MuGMTCandCollection> ( gmt_data, gmt_emul, GMT,GMTmain);
831  if(m_doSys[GMT]&&isValid[GMT]) process<L1MuRegionalCandCollection> ( gmt_rdt_data, gmt_rdt_emul, GMT,GMTrdt);
832  if(m_doSys[GMT]&&isValid[GMT]) process<L1MuGMTCandCollection> ( gmt_can_data, gmt_can_emul, GMT,GMTcnd);
833 
834  // >>---- GLT ---- <<
835  GltDEDigi gltdigimon;
836 
837  if(m_doSys[GLT] && isValid[GLT] ) {
838 
840  bool prt = false;
841  if(!m_dumpMode)
842  prt = false;
843  else if(m_dumpMode==-1)
844  prt=true;
845 
846  if(dumpEvent_ && prt) {
847  m_dumpFile << "\nEntry: " << nevt_
848  << " (event:" << evtNum_
849  << " | run:" << runNum_
850  << ")\n" << std::flush;
851  dumpEvent_=false;
852  }
853 
854  m_dumpFile << "\n GT...\n";
855 
856  if(glt_rdt_data.isValid() && glt_rdt_emul.isValid()) {
857 
858  //fill gt mon info
859  bool globalDBit[2];
860  std::vector<bool> gltDecBits[2], gltTchBits[2];
861  globalDBit[0] = glt_rdt_data->decision();
862  globalDBit[1] = glt_rdt_emul->decision();
863  gltDecBits[0] = glt_rdt_data->decisionWord();
864  gltDecBits[1] = glt_rdt_emul->decisionWord();
865  //gltTchBits[0] = glt_rdt_data->gtFdlWord().gtTechnicalTriggerWord();
866  //gltTchBits[1] = glt_rdt_emul->gtFdlWord().gtTechnicalTriggerWord();
867  gltTchBits[0] = glt_rdt_data->technicalTriggerWord();
868  gltTchBits[1] = glt_rdt_emul->technicalTriggerWord();
869  gltdigimon.set(globalDBit, gltDecBits, gltTchBits);
870 
871  DEncand[GLT][0]=1; DEncand[GLT][1]=1;
872  DEmatchEvt[GLT] = compareCollections(glt_rdt_data, glt_rdt_emul);
873  }
874 
876  if(glt_evm_data.isValid() && glt_evm_emul.isValid())
877  DEmatchEvt[GLT] &= compareCollections(glt_evm_data, glt_evm_emul);
878  if(glt_obj_data.isValid() && glt_obj_emul.isValid())
879  DEmatchEvt[GLT] &= compareCollections(glt_obj_data, glt_obj_emul);
880 
881  char ok[10];
882  char dumptofile[1000];
883  if(DEmatchEvt[GLT]) sprintf(ok,"successful");
884  else sprintf(ok,"failed");
885  sprintf(dumptofile," ...GT data and emulator comparison: %s\n", ok);
886  m_dumpFile<<dumptofile;
887  }
888 
889  if(verbose())
890  std::cout << "L1Comparator done processing all collections.\n" << std::flush;
891 
892  if(verbose()) {
893  std::cout << "[L1Comparator] sys match? << evt." << nevt_ << ": ";
894  for(int i=0; i<DEnsys; i++)
895  std::cout << DEmatchEvt[i] << " ";
896  std::cout << std::endl;
897  }
898 
899 
900  // >>---- Event match? ---- <<
901 
902  bool evt_match = true;
903  for(int i=0; i<DEnsys; i++)
904  evt_match &= DEmatchEvt[i];
905 
906 
907  /* char ok[10];
908  if(evt_match) sprintf(ok,"GOOD :]");
909  else sprintf(ok,"BAD !!!");
910  char dumptofile[1000];
911  sprintf(dumptofile,"\n -> event data and emulator match... %s\n", ok);
912  m_dumpFile<<dumptofile;
913  */
914 
915  // >>---- Global match? ---- <<
916  m_match &= evt_match;
917  m_dumpFile << std::flush;
918 
919  //if collection is empty, add empty digi
920  if(m_dedigis.size()==0) {
921  if(verbose())
922  std::cout << "\n [L1Comparator] adding empty collection to DErecord\n";
923  m_dedigis.push_back(L1DataEmulDigi());
924  }
925 
926  // >>---- d|e record ---- <<
927  std::auto_ptr<L1DataEmulRecord> record
928  (new L1DataEmulRecord(evt_match,m_doSys,DEmatchEvt,DEncand,m_dedigis, gltdigimon));
929  if(verbose()) {
930  std::cout << "\n [L1Comparator] printing DErecord"
931  << "(entry:"<< nevt_
932  << "|evt:" << evtNum_
933  << "|run:" << runNum_
934  << "):\n" << std::flush;
935  std::cout << *record
936  << "\n" << std::flush;
937  }
938 
939  iEvent.put(record);
940 
942  bool dorawdata = false;
943  if(dorawdata) {
944  edm::Handle<FEDRawDataCollection> raw_fedcoll_data;
945  edm::Handle<FEDRawDataCollection> raw_fedcoll_emul;
946  iEvent.getByLabel(m_FEDsource[0], raw_fedcoll_data);
947  iEvent.getByLabel(m_FEDsource[1], raw_fedcoll_emul);
948  bool rawval=true;
949  rawval &= raw_fedcoll_data.isValid();
950  rawval &= raw_fedcoll_emul.isValid();
951  if(rawval)
952  compareFedRawCollections(raw_fedcoll_data,raw_fedcoll_emul, m_fedId);
953  }
954 
955  if(verbose())
956  std::cout << "L1comparator::analize() end. " << nevt_ << std::endl;
957 
958 }
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
std::vector< CSCALCTDigi > CSCALCTDigiCollection_
Definition: DEtrait.h:73
const int DEnsys
Definition: DEtrait.h:38
const std::string & label
Definition: MVAComputer.cc:186
int DEncand[dedefs::DEnsys][2]
Definition: L1Comparator.h:95
JetCorrectorParameters::Record record
Definition: classes.h:11
void clear()
clear this ALCT
Definition: CSCALCTDigi.cc:37
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
edm::InputTag m_FEDsource[2]
Definition: L1Comparator.h:99
edm::InputTag m_DEsource[dedefs::DEnsys][4]
Definition: L1Comparator.h:88
void setPhiValue(float phiVal)
Setters for physical values.
Definition: L1MuGMTCand.h:179
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
std::vector< CSCCLCTDigi > CSCCLCTDigiCollection_
Definition: DEtrait.h:74
std::vector< L1CSCSPStatusDigi > L1CSCSPStatusDigiCollection_
Definition: DEtrait.h:76
int j
Definition: DBlmapReader.cc:9
bool compareCollections(edm::Handle< L1GlobalTriggerReadoutRecord > data, edm::Handle< L1GlobalTriggerReadoutRecord > emul)
bool isValid() const
Definition: HandleBase.h:76
Definition: L1GtFwd.h:20
std::vector< L1MuDTChambThDigi > L1MuDTChambThDigiCollection
Definition: DEtrait.h:71
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
std::vector< L1MuRegionalCand > L1MuRegionalCandCollection
bool compareFedRawCollections(edm::Handle< FEDRawDataCollection > data, edm::Handle< FEDRawDataCollection > emul, int fedid)
std::vector< L1MuDTChambPhDigi > L1MuDTChambPhDigiCollection
Definition: DEtrait.h:70
std::vector< CSCCorrelatedLCTDigi > CSCCorrelatedLCTDigiCollection_
Definition: DEtrait.h:75
std::vector< DigiType >::const_iterator const_iterator
bool DEmatchEvt[dedefs::DEnsys]
Definition: L1Comparator.h:94
L1DEDigiCollection m_dedigis
Definition: L1Comparator.h:96
edm::EventID id() const
Definition: EventBase.h:56
std::ofstream m_dumpFile
Definition: L1Comparator.h:91
void clear()
clear this CLCT
Definition: CSCCLCTDigi.cc:60
std::pair< const_iterator, const_iterator > Range
tuple cout
Definition: gather_cfg.py:41
std::vector< L1MuGMTCand > L1MuGMTCandCollection
Definition: DEtrait.h:77
bool m_doSys[dedefs::DEnsys]
Definition: L1Comparator.h:89
int L1Comparator::verbose ( )
inlineprivate

Definition at line 78 of file L1Comparator.h.

References verbose_.

78 {return verbose_;}

Member Data Documentation

bool L1Comparator::DEmatchEvt[dedefs::DEnsys]
private

Definition at line 94 of file L1Comparator.h.

int L1Comparator::DEncand[dedefs::DEnsys][2]
private

Definition at line 95 of file L1Comparator.h.

bool L1Comparator::dumpEvent_
private

Definition at line 86 of file L1Comparator.h.

int L1Comparator::evtNum_
private

Definition at line 83 of file L1Comparator.h.

L1DEDigiCollection L1Comparator::m_dedigis
private

Definition at line 96 of file L1Comparator.h.

edm::InputTag L1Comparator::m_DEsource[dedefs::DEnsys][4]
private

Definition at line 88 of file L1Comparator.h.

bool L1Comparator::m_doSys[dedefs::DEnsys]
private

Definition at line 89 of file L1Comparator.h.

std::ofstream L1Comparator::m_dumpFile
private

Definition at line 91 of file L1Comparator.h.

std::string L1Comparator::m_dumpFileName
private

Definition at line 90 of file L1Comparator.h.

int L1Comparator::m_dumpMode
private

Definition at line 92 of file L1Comparator.h.

int L1Comparator::m_fedId
private

Definition at line 98 of file L1Comparator.h.

edm::InputTag L1Comparator::m_FEDsource[2]
private

Definition at line 99 of file L1Comparator.h.

bool L1Comparator::m_match
private

Definition at line 93 of file L1Comparator.h.

int L1Comparator::nevt_
private

Definition at line 82 of file L1Comparator.h.

int L1Comparator::runNum_
private

Definition at line 84 of file L1Comparator.h.

int L1Comparator::verbose_
private

Definition at line 85 of file L1Comparator.h.

Referenced by verbose().