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

Comparing UserCode/MitHzz4l/Selection/src/applySelection.cc (file contents):
Revision 1.32 by anlevin, Sat Jun 2 12:17:29 2012 UTC vs.
Revision 1.45 by khahn, Tue Jun 19 21:21:13 2012 UTC

# Line 40 | Line 40 | using namespace std;
40   #include "MCParticle.h"
41   #include "TriggerMask.h"
42   #include "TriggerTable.h"
43 + #include "TriggerObject.h"
44 + #include "TriggerObjectRel.h"
45   #include "Names.h"
46   #include "BaseMod.h"
47 + #include "TriggerObjectsTable.h"
48  
49   //
50   // our headers
# Line 59 | Line 62 | using namespace std;
62   #include "InfoStruct.h"
63   #include "GenInfoStruct.h"
64   #include "WeightStruct.h"
62 //#include "GlobalDataAndFuncs.h"
63 #include "RunLumiRangeMap.h"
64
65   #include "AngleTuple.h"
66   #include "FOTuple.h"
67  
68 + #include "RunLumiRangeMap.h"
69   #include "SampleWeight.h"
70   #include "EfficiencyWeightsInterface.h"
71 + #include "SelectionFuncs.h"
72  
73   #include "SimpleLepton.h"
74  
# Line 96 | Line 98 | vector<bool>   PFnoPUflag;;
98   //----------------------------------------------------------------------------
99   void initPUWeights();
100   double getPUWeight(unsigned npu);
99 void setEra(string, ControlFlags&);
100 void setEffiencyWeights(EventData&, WeightStruct& );
101   void initRunLumiRangeMap();
102 void initEvtRhoMap(map<unsigned,float> &);
103 unsigned makePFnoPUArray(mithep::Array<PFCandidate> * fPFCandidates,
104                         vector<bool> &pfNoPileUpFlag,
105                         const mithep::Array<mithep::Vertex>     * vtxArr );
102   //----------------------------------------------------------------------------
103  
104  
# Line 173 | Line 169 | int main(int argc, char** argv)
169    TChain * hltchain = new TChain("HLT");
170  
171    string fname;
172 +  unsigned total_unskimmed=0;
173    if( !ctrl.inputfiles.empty() ) {
174      ifstream f(ctrl.inputfiles.c_str());
175      while (f >> fname) {
# Line 180 | Line 177 | int main(int argc, char** argv)
177        cout << "adding inputfile : " << fname.c_str() << endl;
178        entrymap[string(fname.c_str())] = unskimmedEntries(fname.c_str());
179        cout << "unskimmed entries: " << entrymap[string(fname.c_str())] << endl;
180 +      total_unskimmed += entrymap[string(fname.c_str())];
181        chain->AddFile(fname.c_str());
182        hltchain->AddFile(fname.c_str());
183      }
184    } else {
185      cout << "adding inputfile : " << ctrl.inputfile.c_str() << endl;
186 <    unsigned tmpent = unskimmedEntries(ctrl.inputfile.c_str());
187 <    cout << "tmpent: " << tmpent << endl;
188 <    entrymap[string(ctrl.inputfile.c_str())] = unskimmedEntries(ctrl.inputfile.c_str());
189 <    cout << "unskimmed entries: " << entrymap[string(ctrl.inputfile.c_str())] << endl;
186 >    unsigned unsk_ents = unskimmedEntries(ctrl.inputfile.c_str());
187 >    entrymap[string(ctrl.inputfile.c_str())] = unsk_ents;
188 >    cout << "unskimmed entries: " << unsk_ents << endl;
189 >    total_unskimmed += unsk_ents;
190      chain->AddFile(ctrl.inputfile.c_str());
191      hltchain->AddFile(ctrl.inputfile.c_str());
192    }
193 +  // // write the total number of unskimmed events that went into making this output file to a text file
194 +  // writeEntries(ctrl,total_unskimmed);
195  
196    const char * ofname;
197    if( strcmp( ctrl.outputfile.c_str(), "") ) {
# Line 205 | Line 205 | int main(int argc, char** argv)
205    SimpleTable xstab(xspath.c_str());
206  
207  
208 +
209    //
210    // Setup
211    //--------------------------------------------------------------------------------------------------------------
# Line 219 | Line 220 | int main(int argc, char** argv)
220    nt.makeKinematicsBranch(kinematics);
221    nt.makeInfoBranch(evtinfo);
222  
223 +  
224    FOTuple foTree( nt.getFile(), (const char*)"FOtree");
225    foTree.makeFailedLeptonBranch(failingLeptons);
226 <  foTree.makeZLeptonBranch(passingLeptons);
226 >  foTree.makePassedLeptonBranch(passingLeptons);
227  
228    TH1F * h_wf11_hpt;
229    if(ctrl.mc) {
230      nt.makeWeightBranch(weights);
231 <    nt.makeGenInfoBranch(geninfo);
232 <    initEfficiencyWeights();
231 >    if(ctrl.fillGen ) nt.makeGenInfoBranch(geninfo);
232 >    if(ctrl.efftype != string("WTF?")) initEfficiencyWeights();
233      initPUWeights();
234  
235      // Higgs only, pt reweighting
# Line 245 | Line 247 | int main(int argc, char** argv)
247    }
248  
249    //  initMuonIDMVA();
250 <  initMuonIsoMVA();
249 <  initElectronIDMVA();
250 <  initElectronIsoMVA();
250 >  initElectronIDMVAV1();
251    initTrigger();
252  
253  // hack
254  initEvtRhoMap(evtrhoMap);
255
256  
253    //
254    // Setup tree I/O
255    //--------------------------------------------------------------------------------------------------------------
# Line 261 | Line 257 | int main(int argc, char** argv)
257    TTree *eventTree=0;  
258    string currentFile("");
259  
260 +  UInt_t fNMaxTriggers = 1024;
261    mithep::EventHeader *info    = new mithep::EventHeader();
262    mithep::Array<mithep::Electron>             *electronArr   = new mithep::Array<mithep::Electron>();
263    mithep::Array<mithep::Muon>                 *muonArr       = new mithep::Array<mithep::Muon>();
# Line 272 | Line 269 | int main(int argc, char** argv)
269    mithep::Array<mithep::MCParticle>           *mcArr         = new mithep::Array<mithep::MCParticle>();
270    mithep::MCEventInfo                         *mcEvtInfo     = new mithep::MCEventInfo();
271    mithep::TriggerMask                         *trigMask      = new mithep::TriggerMask();
272 <  mithep::TriggerTable                        *hltTable      = new mithep::TriggerTable();
272 >  mithep::TriggerTable                        *hltTable      = new mithep::TriggerTable(fNMaxTriggers);
273    vector<string>                              *hltTableStrings  = new vector<string>();
274 +  vector<string>                              *hltLabelStrings  = new vector<string>();
275 +  mithep::Array<mithep::TriggerObject>        *hltObjArr     = new mithep::Array<mithep::TriggerObject>();
276 +  mithep::Array<mithep::TriggerObjectRel>     *hltRelsArr    = new mithep::Array<mithep::TriggerObjectRel>();
277 +  std::vector<std::string>                    *hltTab        = new vector<string>();
278 +  std::vector<std::string>                    *hltLab        = new vector<string>();
279 +  TriggerObjectsTable                         *fTrigObjs     = new TriggerObjectsTable(hltTable,fNMaxTriggers);
280 +
281  
282    TString fElectronName(Names::gkElectronBrn);
283    TString fMuonName(Names::gkMuonBrn);
# Line 287 | Line 291 | int main(int argc, char** argv)
291    TString fMCEvtInfoName(Names::gkMCEvtInfoBrn);
292    TString fTriggerMaskName(Names::gkHltBitBrn);
293    TString fTriggerTableName(Names::gkHltTableBrn);
294 +  TString fTriggerLabelName(Names::gkHltLabelBrn);
295 +  TString fTriggerObjectName(Names::gkHltObjBrn);
296 +  TString fTriggerObjectRelsName(Form("HLTObjectsRelation"));
297 +
298 + //   TString fHLTLabName(Names::gkHltLabelBrn);
299 + //   TString fHLTTabName(Names::gkHltTableBrn);
300 + //   TString fHLTTabNamePub(Form("%sFwk",fHLTTabName.Data()));
301 + //   TString fHLTLabNamePub(Form("%sFwk",fHLTLabName.Data()));
302 + //   TString fObjsNamePub(Form("%sFwk",fTriggerObjectName.Data()));
303 +
304 +
305    
306    chain->SetBranchAddress(fInfoName,        &info);
307    chain->SetBranchAddress(fElectronName,    &electronArr);
# Line 301 | Line 316 | int main(int argc, char** argv)
316    chain->SetBranchAddress(fPileupEnergyDensityName, &puDArr);
317    chain->SetBranchAddress(fTrackName, &trkArr);
318    chain->SetBranchAddress(fTriggerMaskName, &trigMask);
319 +  chain->SetBranchAddress(fTriggerObjectName,  &hltObjArr);
320 +  chain->SetBranchAddress(fTriggerObjectRelsName,  &hltRelsArr);
321 +  //  chain->SetBranchAddress(fHLTTabNamePub,  &hltTab);
322 +  //  chain->SetBranchAddress(fHLTLabNamePub,  &hltLab);
323 +
324    cout << "hlttable: " << fTriggerTableName << endl;
325    hltchain->SetBranchAddress(fTriggerTableName, &hltTableStrings);
326 +  hltchain->SetBranchAddress(fTriggerLabelName, &hltLabelStrings);
327  
328    mithep::Vertex              vtx;          // best primary vertex in the event
329  
# Line 322 | Line 343 | int main(int argc, char** argv)
343    int imax = chain->GetEntries();
344    cout << "nEntries: " << imax << endl;
345  
325
346    //
347    // Loop !!!!!!!!!
348    //--------------------------------------------------------------------------------------------------------------
# Line 331 | Line 351 | int main(int argc, char** argv)
351        chain->GetEntry(ientry);
352        if(!(ientry%1000)) cerr << "entry: " << ientry << endl;
353  
354 < #ifdef HACKED_RHOS
355 <      float rho = evtrhoMap[info->EvtNum()];
356 < #endif
354 >      if( ctrl.debug ) {
355 >        cout << "-----------------------------------------------------------------" << endl;
356 >        cout << "-----------------------------------------------------------------" << endl;
357 >        cout << "Run: " << info->RunNum()
358 >             << "\tEvt: " << info->EvtNum()
359 >             << "\tLumi: " << info->LumiSec()
360 >             << endl;
361 >        cout << "-----------------------------------------------------------------" << endl;
362 >      }
363 >
364 >
365        string fname = string(chain->GetFile()->GetEndpointUrl()->GetFile());
366        setEra( fname, ctrl );
367  
368  
369 +
370        //
371        // pfNoPU
372        //
# Line 387 | Line 416 | int main(int argc, char** argv)
416          if( string(chain->GetFile()->GetEndpointUrl()->GetFile()) != currentFile ) {
417            currentFile = string(chain->GetFile()->GetEndpointUrl()->GetFile());
418            hltchain->SetBranchAddress(fTriggerTableName, &hltTableStrings);
419 +          hltchain->SetBranchAddress(fTriggerLabelName, &hltLabelStrings);
420            hltchain->GetEntry(0);
421            hltTable->Clear();
422            fillTriggerNames(hltTable, hltTableStrings );
# Line 397 | Line 427 | int main(int argc, char** argv)
427          if( !passHLTMC(triggerBits, info->RunNum(), info->EvtNum(), k2012_MC ) ) {
428            passes_HLT_MC = false;
429          }
430 +
431 +        setHLTObjectRelations( hltObjArr, hltRelsArr, hltTableStrings, hltLabelStrings, fTrigObjs );
432 +
433        } else {
434          //
435          // JSON
436          //
437 <        /*
438 <        RunLumiRangeMap::RunLumiPairType rl(info->RunNum(), info->LumiSec());      
439 <        if( !(rlrm.HasRunLumi(rl)) )  {
440 <          if( ctrl.debug ) cout << "\tfails JSON" << endl;
441 <          continue;
437 >        if(!(ctrl.noJSON) ) {
438 >          RunLumiRangeMap::RunLumiPairType rl(info->RunNum(), info->LumiSec());      
439 >          if( !(rlrm.HasRunLumi(rl)) )  {
440 >            if( ctrl.debug ) cout << "fails JSON" << endl;
441 >            continue;
442 >          }
443          }
444 <        */
444 >        
445          //
446          // trigger
447          //
448          if( string(chain->GetFile()->GetEndpointUrl()->GetFile()) != currentFile ) {
449            currentFile = string(chain->GetFile()->GetEndpointUrl()->GetFile());
450            hltchain->SetBranchAddress(fTriggerTableName, &hltTableStrings);
451 +          hltchain->SetBranchAddress(fTriggerLabelName, &hltLabelStrings);
452            hltchain->GetEntry(0);
453            hltTable->Clear();
454            fillTriggerNames(hltTable, hltTableStrings );
455          }
456 +
457 +        setHLTObjectRelations( hltObjArr, hltRelsArr, hltTableStrings, hltLabelStrings, fTrigObjs );
458 +        printTriggerObjs( hltTable, fTrigObjs );
459 +
460          if( ctrl.debug ) cout << "file is : " << currentFile  << endl;
461          /*
462          fillTriggerBits( hltTable, trigMask, triggerBits );
# Line 438 | Line 477 | int main(int argc, char** argv)
477  
478          // reference
479          apply_HZZ4L_reference_selection(ctrl, info,
480 <                                         vtxArr,
481 <                                         pfArr,
482 < #ifdef HACKED_RHOS
483 <                                         rho,
484 < #else
485 <                                         puDArr,
486 < #endif
487 <                                         electronArr,
488 <                                         &electronReferencePreSelection,
489 <                                         &electronReferenceIDMVASelectionV1,
490 <                                         &electronReferenceIsoSelection,
491 <                                         muonArr,
453 <                                         &muonReferencePreSelection,
454 <                                         &muonIDPFSelection,
455 <                                         &muonReferenceIsoSelection);
456 <
457 <      /*
458 <        // evolved
459 <        apply_HZZ4L_reference2_selection(ctrl, info,
460 <                                         vtx,
461 <                                         pfArr,
462 <                                         //rho,
463 <                                         puDArr,
464 <                                         electronArr,
465 <                                         &electronReferencePreSelection,
466 <                                         //&electronPreSelection,
467 <                                         &electronReferenceIDMVASelection,
468 <                                         &electronIsoMVASelection,
469 <                                         muonArr,
470 <                                         &muonReferencePreSelection,
471 <                                         //&muonPreSelection,
472 <                                         &muonIDPFSelection,
473 <                                         &muonIsoMVASelection);
474 <      */
475 <
480 >                                        vtxArr,
481 >                                        pfArr,
482 >                                        puDArr,
483 >                                        electronArr,
484 >                                        &electronReferencePreSelection,
485 >                                        &electronReferenceIDMVASelectionV1,
486 >                                        &electronReferenceIsoSelection,
487 >                                        muonArr,
488 >                                        &muonReferencePreSelection,
489 >                                        &muonIDPFSelection,
490 >                                        &muonReferenceIsoSelection);
491 >      
492        if( ctrl.debug ) cout << endl;
493  
494  
# Line 499 | Line 515 | int main(int argc, char** argv)
515          fillMassErrors(ret4l,muonArr,electronArr,kinematics);
516          fillEventInfo(info,evtinfo);
517          if( ctrl.mc) {
518 <          setEffiencyWeights(ret4l, weights);
519 <           if(ctrl.debug)
520 <             cout << "w: " << weights.w << "\t"
521 <                  << "won: " << weights.won << "\t"
522 <                  << "woff: " << weights.woff << endl;
518 >          if( std::string(ctrl.efftype) != std::string("WTF?")) {
519 >            setEffiencyWeights(ret4l, weights);
520 >          } else {
521 >            weights.won = weights.woff = 1.;
522 >          }
523 >          if(ctrl.debug)
524 >            cout << "w: " << weights.w << "\t"
525 >                 << "won: " << weights.won << "\t"
526 >                 << "woff: " << weights.woff << endl;
527          }
528          
529  
# Line 513 | Line 533 | int main(int argc, char** argv)
533                << "\trun: " << evtinfo.run
534                << "\tevt: " << evtinfo.evt
535                << "\tlumi: " << evtinfo.lumi
536 <              << "\tcostheta1: " << angles.costheta1
537 <              << "\tcostheta2: " << angles.costheta2
538 <              << "\tcostheta*: " << angles.costhetastar
539 <              << "\tbdt: " << angles.bdt
536 >              << "\tchannel: " << kinematics.channel
537 >              << "\tm4l: " << kinematics.m4l
538 >              << "\tmZ1: " << kinematics.mZ1
539 >              << "\tmZ2: " << kinematics.mZ2
540                << endl;
541          pass++;
542          //      if( pass > 3 ) break;
543  
544 <      } else if( ret4l.status.selectionBits.test(PASS_GOODZ1) ) { // save for fakes ...
545 <        //      if(ctrl.debug) {
544 >      } else if( ret4l.status.selectionBits.test(PASS_GOODZ1) &&
545 >                 ret4l.status.selectionBits.to_ulong() < (1UL<<PASS_4L)) { // save for fakes ...
546 >        if(ctrl.debug) {
547            cout << "failingLeptons : " << failingLeptons.size() << endl;
548            for( int f=0; f<failingLeptons.size(); f++ ) {
549              SimpleLepton  l = failingLeptons[f];
# Line 531 | Line 552 | int main(int argc, char** argv)
552                   << "pT: " << l.vec.Pt()  << "\t"
553                   << "eta: " << l.vec.Eta()
554                   << endl;
555 <            //    }
555 >          }
556          }
557          foTree.Fill();
558 +      } else {
559 +        cout << "failing with some other code : " << ret4l.status.selectionBits << endl;
560        }
561      }  
562  
# Line 565 | Line 588 | int main(int argc, char** argv)
588   }
589  
590  
568
569 //----------------------------------------------------------------------------
570 void setEffiencyWeights(EventData & evtdat, WeightStruct & weights )
571 //----------------------------------------------------------------------------
572 {
573  vector<SimpleLepton> lepvec = evtdat.Z1leptons;
574  lepvec.insert(lepvec.end(), evtdat.Z2leptons.begin(), evtdat.Z2leptons.end());
575  double w_offline=-1, werr_offline=0;
576  double w_online=-1, werr_online=0;
577  
578  vector< pair <double,double> > wlegs; // pair here is eff & err
579  vector< pair <float,float> > mvec;  // pair here is eta & pt
580
581  //      vector< pair <float,float> > evec;  // pair here is eta & pt
582  // now deal with medium vs loose
583  vector< pair< bool, pair <float,float> > > evec;  // pair here is eta & pt
584  
585  for( int k=0; k<lepvec.size(); k++ ) {
586    if( abs(lepvec[k].type) == 13 ) {
587      mvec.push_back( std::pair<float,float> (fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt()) );
588      wlegs.push_back( muonPerLegOfflineEfficiencyWeight( fabs(lepvec[k].vec.Eta()),
589                                                          lepvec[k].vec.Pt() ) );
590    } else {
591      
592      // now deal with medium vs loose
593      //              evec.push_back( std::pair<float,float> (fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt()) );
594      
595      std::pair<float,float> tmppair(fabs(lepvec[k].vec.Eta()), lepvec[k].vec.Pt());
596      evec.push_back( std::pair<bool, std::pair<float,float> > (lepvec[k].isTight, tmppair) );
597      
598      //              wlegs.push_back( elePerLegOfflineEfficiencyWeight(  fabs(lepvec[k].vec.Eta()),
599      //                                                                 lepvec[k].vec.Pt() ) );
600      
601      wlegs.push_back( elePerLegOfflineEfficiencyWeight(  fabs(lepvec[k].vec.Eta()),
602                                                          lepvec[k].vec.Pt(),
603                                                          lepvec[k].isTight ) );
604      
605    }
606  }
607  
608  pair<double,double> offpair = getOfflineEfficiencyWeight( wlegs );
609  weights.woff    = offpair.first;
610  weights.werroff = offpair.second;
611  
612  pair<double,double> onpair  = getOnlineEfficiencyWeight( mvec, evec );
613  weights.won    = onpair.first;
614  weights.werron = onpair.second;
615 }
616
617
591   //----------------------------------------------------------------------------
592   void initRunLumiRangeMap()
593   //----------------------------------------------------------------------------
# Line 628 | Line 601 | void initRunLumiRangeMap()
601    // r11b
602    rlrm.AddJSONFile(std::string("./data/Cert_160404-180252_7TeV_PromptReco_Collisions11_JSON.txt"));  
603    */
604 +
605 +  // 2012 only for now ...
606 +  rlrm.AddJSONFile(std::string("./data/Cert_190456-194479_8TeV_PromptReco_Collisions12_JSON.txt"));  
607 +
608   };
609  
610  
# Line 646 | Line 623 | double getPUWeight(unsigned npu)
623    return hpu->GetBinContent(hpu->FindBin(npu));
624   }
625  
649 //----------------------------------------------------------------------------
650 void initEvtRhoMap( map<unsigned, float> & evtrhoMap )
651 //----------------------------------------------------------------------------
652 {
653  unsigned evt;
654  float rho;
655
656  cout << "initialzing EvtRhoMap ";
657  //FILE * f = fopen("evtrho.dat", "r");
658  //  FILE * f = fopen("allrho.cali.uniq.dat", "r");
659  FILE * f = fopen("/data/blue/khahn/CMSSW_4_4_2/src/MitHzz4l/allrhoAA.cali.uniq.dat", "r");
660  int lcount=0;
661  while( fscanf( f, "%u:%f", &evt, &rho ) ) {
662    if( feof(f) ) break;
663    evtrhoMap[evt] = rho;
664    lcount++;
665    if( !(lcount%1000) ) cout << "."; flush(cout);
666  }
667  cout << " done" << endl;
668 }
669
670 //----------------------------------------------------------------------------
671 unsigned makePFnoPUArray(mithep::Array<PFCandidate> * fPFCandidates,
672                         vector<bool> &pfNoPileUpflag,
673                         const mithep::Array<mithep::Vertex>      * vtxArr )
674 //----------------------------------------------------------------------------
675 {
676  for(UInt_t i = 0; i < fPFCandidates->GetEntries(); i++) {
677    const PFCandidate *pf = fPFCandidates->At(i);
678    assert(pf);
679
680    if(pf->PFType() == PFCandidate::eHadron) {
681      if(pf->HasTrackerTrk() &&
682         vtxArr->At(0)->HasTrack(pf->TrackerTrk()) &&
683         vtxArr->At(0)->TrackWeight(pf->TrackerTrk()) > 0) {
684
685        pfNoPileUpflag.push_back(1);
686
687      } else {
688
689        Bool_t vertexFound = kFALSE;
690        const Vertex *closestVtx = 0;
691        Double_t dzmin = 10000;
692        
693        // loop over vertices
694        for(UInt_t j = 0; j < vtxArr->GetEntries(); j++) {
695          const Vertex *vtx = vtxArr->At(j);
696          assert(vtx);
697          
698          if(pf->HasTrackerTrk() &&
699             vtx->HasTrack(pf->TrackerTrk()) &&
700             vtx->TrackWeight(pf->TrackerTrk()) > 0) {
701            vertexFound = kTRUE;
702            closestVtx = vtx;
703            break;
704          }
705          Double_t dz = fabs(pf->SourceVertex().Z() - vtx->Z());
706          if(dz < dzmin) {
707            closestVtx = vtx;
708            dzmin = dz;
709          }
710        }
711
712        //      if(fCheckClosestZVertex) {
713        if(1) {
714          // Fallback: if track is not associated with any vertex,
715          // associate it with the vertex closest in z
716          if(vertexFound || closestVtx != vtxArr->At(0)) {
717            //      pfPileUp->Add(pf);
718            pfNoPileUpflag.push_back(0);
719          } else {
720            pfNoPileUpflag.push_back(1);
721          }
722        } else {
723          if(vertexFound && closestVtx != vtxArr->At(0)) {
724            //      pfPileUp->Add(pf);
725            pfNoPileUpflag.push_back(0);
726          } else {
727            //      PFCandidate * pfNoPileUp->AddNew(); // Ridiculous but that's how it is
728            pfNoPileUpflag.push_back(1);
729          }
730        }
731      } //hadron & trk stuff
732    } else { // hadron
733      //      PFCandidate * ptr = pfNoPileUp->AddNew();
734      pfNoPileUpflag.push_back(1);
735    }
736  } // Loop over PF candidates
737
738  return pfNoPileUpflag.size();
739 }
740
741 void setEra(string fname, ControlFlags &ctrl)
742 {
743  if( ctrl.mc && (fname.find("f11-") != string::npos)  ) ctrl.era=2011 ;
744  if( ctrl.mc && (fname.find("s12-") != string::npos)  ) ctrl.era=2012 ;
745  if( !ctrl.mc && (fname.find("r11-") != string::npos)  ) ctrl.era=2011 ;
746  if( !ctrl.mc && (fname.find("r12-") != string::npos)  ) ctrl.era=2012 ;
747 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines