ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/L1RpcTriggerAnalysis/src/Pattern.cc
Revision: 1.1
Committed: Fri May 17 13:04:54 2013 UTC (11 years, 11 months ago) by konec
Content type: text/plain
Branch: MAIN
Log Message:
extenstion for OTF

File Contents

# User Rev Content
1 konec 1.1 #include "UserCode/L1RpcTriggerAnalysis/interface/Pattern.h"
2    
3     #include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
4     #include "DataFormats/MuonDetId/interface/RPCDetId.h"
5     #include "DataFormats/MuonDetId/interface/CSCDetId.h"
6     #include "DataFormats/MuonDetId/interface/DTChamberId.h"
7     #include "UserCode/L1RpcTriggerAnalysis/interface/RPCDetIdUtil.h"
8     #include "UserCode/L1RpcTriggerAnalysis/interface/DTphDigiSpec.h"
9     #include "UserCode/L1RpcTriggerAnalysis/interface/CSCDigiSpec.h"
10     #include "UserCode/L1RpcTriggerAnalysis/interface/RPCDigiSpec.h"
11    
12    
13     bool Pattern::add ( std::pair<uint32_t, unsigned int > aData)
14     {
15     for (DataType::const_iterator it=theData.begin(); it!= theData.end(); it++) {
16     if (it->first == aData.first) {
17     return false;
18     }
19     }
20     theData.push_back(aData);
21     return true;
22     }
23    
24     std::ostream & operator << (std::ostream &out, const Pattern &o)
25     {
26     out <<" Pattern: size: "<<o.size();
27     for (Pattern::DataType::const_iterator it=o.theData.begin(); it!= o.theData.end(); it++) {
28     DetId detId( it->first);
29     switch (detId.subdetId()) {
30     case MuonSubdetId::RPC: { out << std::endl <<" RPC: "<<RPCDigiSpec(it->first, it->second); break; }
31     case MuonSubdetId::DT: { out << std::endl <<" DT: "<<DTphDigiSpec(it->first, it->second); break; }
32     case MuonSubdetId::CSC: { out << std::endl <<" CSC: "<<CSCDigiSpec(it->first, it->second); break; }
33     };
34     }
35     return out;
36     }
37