ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/L1RpcTriggerAnalysis/src/AnaMenu.cc
(Generate patch)

Comparing UserCode/L1RpcTriggerAnalysis/src/AnaMenu.cc (file contents):
Revision 1.2 by konec, Tue Nov 6 12:56:51 2012 UTC vs.
Revision 1.5 by konec, Sun Dec 16 22:56:15 2012 UTC

# Line 16 | Line 16 | namespace {
16   }
17  
18  
19 + void  AnaMenu::updateMenu(const std::vector<std::string> & menuL1, const std::vector<std::string> & menuHLT)
20 + {
21 +  if (menuL1.size() != 0) theMenuL1 = menuL1;
22 +  if (menuHLT.size() != 0) theMenuHLT = menuHLT;
23 + }
24 +
25   bool AnaMenu::filter( const EventObj* ev, const MuonObj* muon,
26                        const TriggerMenuResultObj *bitsL1,
27                        const TriggerMenuResultObj *bitsHLT)
28  
29   {
24  if (bitsL1->names.size() != 0)    namesL1=bitsL1->names;
25  if (bitsHLT->names.size() != 0)   namesHLT=bitsHLT->names;
30    const std::vector<unsigned int> & algosL1 = bitsL1->firedAlgos;
31    const std::vector<unsigned int> & algosHLT = bitsHLT->firedAlgos;
32  
29
33    typedef std::vector<unsigned int>::const_iterator CIT;
34  
35 < //  static int count = 0;
36 < //  std::cout <<"----------"<<std::endl;
37 <  bool hasNoL1Mu= false;
35 >
36 >  bool okL1 = false;
37 >  std::vector<std::string> acceptL1_Names = theConfig.exists("acceptL1_Names") ?  theConfig.getParameter<std::vector<std::string> >("acceptL1_Names") : std::vector<std::string>();
38    for (CIT it=algosL1.begin(); it != algosL1.end(); ++it) {
39 <    std::string nameAlgo = namesL1[*it];
37 < //    std::cout <<nameAlgo << std::endl;
39 >    std::string nameAlgo = theMenuL1[*it];
40      if (theAlgosL1.find(nameAlgo) == theAlgosL1.end()) theAlgosL1[nameAlgo]=0;    
41      bool isMu = ( nameAlgo.find("Mu") != std::string::npos);
42 <    if (!isMu) hasNoL1Mu = true;
42 >    if (theConfig.getParameter<bool>("acceptL1_OtherThanMu") && !isMu ) okL1 = true;
43 >    if (theConfig.getParameter<bool>("acceptL1_Mu") &&  isMu) okL1 = true;
44 >    for ( std::vector<std::string>::const_iterator is=acceptL1_Names.begin(); is != acceptL1_Names.end(); ++is) if (nameAlgo==(*is)) okL1 = true;
45    }
42 // if (hasNoL1Mu) std::cout <<" HAS NO L1 MUON!: " <<++count<< std::endl;
46  
47 <  bool hasNoHLTMu= false;
47 >  bool okHLT = false;
48    for (CIT it=algosHLT.begin(); it != algosHLT.end(); ++it) {
49 <    std::string nameAlgo = namesHLT[*it];
47 < //    std::cout <<nameAlgo << std::endl;
49 >    std::string nameAlgo = theMenuHLT[*it];
50      if (theAlgosHLT.find(nameAlgo) == theAlgosHLT.end()) theAlgosHLT[nameAlgo]=0;    
51 <    if (nameAlgo.find("Physic") != std::string::npos) continue;
52 <    bool isMu = ( (nameAlgo.find("Mu") != std::string::npos) && (nameAlgo.find("Multi") == std::string::npos) );
53 <    if (!isMu) hasNoHLTMu = true;
51 >    bool isMu = (    (    (nameAlgo.find("Mu") != std::string::npos   )
52 >                       && (nameAlgo.find("Multi") == std::string::npos) )
53 >                  || (     nameAlgo.find("muon") != std::string::npos   )  );
54 >    if ( theConfig.getParameter<bool>("acceptHLT_OtherThanMuPhysicsAlCa")
55 >         && !isMu
56 >         && (nameAlgo.find("Physics") == std::string::npos)
57 >         && (nameAlgo.find("AlCa") == std::string::npos) ) okHLT = true;
58 >    if (theConfig.getParameter<bool>("acceptHLT_Mu") && isMu) okHLT = true;
59 >    if (theConfig.getParameter<bool>("acceptHLT_L1")       && (nameAlgo.find("HLT_L1")   != std::string::npos) ) okHLT = true;
60 >    if (theConfig.getParameter<bool>("acceptHLT_Physics")  && (nameAlgo.find("Physics")  != std::string::npos) ) okHLT = true;
61 >    if (theConfig.getParameter<bool>("acceptHLT_ZeroBias") && (nameAlgo.find("ZeroBias") != std::string::npos) ) okHLT = true;
62    }
53 //  if (hasNoHLTMu) std::cout <<" HAS NO HLT MUON!" << std::endl;
63  
64 <  //if (hasNoL1Mu && hasNoHLTMu) {
65 <  if (!hasNoL1Mu && !hasNoHLTMu) {
66 <    for (CIT it=algosL1.begin();  it != algosL1.end();  ++it)  theAlgosL1[ namesL1[*it] ]++;
58 <    for (CIT it=algosHLT.begin(); it != algosHLT.end(); ++it) theAlgosHLT[ namesHLT[*it] ]++;
64 >  if (okL1  && okHLT) {
65 >    for (CIT it=algosL1.begin();  it != algosL1.end();  ++it)  theAlgosL1[ theMenuL1[*it] ]++;
66 >    for (CIT it=algosHLT.begin(); it != algosHLT.end(); ++it) theAlgosHLT[ theMenuHLT[*it] ]++;
67      if (hMuonPt_MEN)  hMuonPt_MEN->Fill(muon->pt());
68      if (hMuonEta_MEN) hMuonEta_MEN->Fill(muon->eta());
69      if (hMuonPhi_MEN) hMuonPhi_MEN->Fill(muon->phi());
70 <    return true;
71 <  }
70 >    return true;
71 >  } else return  false;
72  
65  return  false;
73   }
74  
75   void AnaMenu::resume(TObjArray& histos)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines