Fast Simulation: How to tune HCAL signal response

Scale factors for the HCAL signal response were tuned in CMSSW_5_2_0 by matching the signal at RecHit level with FullSim using a simulated sample of single pions of fixed energy, disactivating the magnetic field and the tracker and imposing all pions to come from (0,0,0).

A new tuning, based on SimHits, is effective since CMSSW_6_2_0.

Practical recipe to tune at RecHit level

This recipe was tested in CMSSW_5_2_0.

Pion gun events

The following instructions make use of Salavat Abdullin's semi-private code for HCAL validation.

  • download this tar file
  • untar with tar -zxvf hcalhits.tgz
  • When running FullSim:
    • cp hcalhits/template_fullsim.py hcalhits/template.py
  • When running FastSim:
    • cvs co FastSimulation/Calorimetry/test
    • cp FastSimulation/Calorimetry/test/piongun_fastsim_cfg.py ./hcalhits/template.py
    • In order to impose the vertex in (0,0,0) in FastSim, follow the instructions from here (remember to recompile)
  • The input source block must be:
  • process.source = cms.Source("PoolSource",
                                    firstEvent = cms.untracked.uint32(XXXXX),
                                    fileNames = cms.untracked.vstring('file:mc.root')
                                )
    
  • edit MYWORKDIR in batch.csh
  • check that SCRAM_ARCH is correct in batch.csh
  • edit number of jobs in make_configs.csh and submit_batch.csh, and preferred queue in submit_batch.csh
  • ./make_configs.csh
  • ./submit_batch.csh

Using the RecHit validation plots

At this point you have a bunch of validation files; if you want to tune at RecHit level you can run the RecHit validation code:

  • run cmsRun merging_cfg.py and obtain, in particular, HcalRecHitsHarvestingME.root
  • cvs co Validation/CaloTowers
  • cd Validation/CaloTowers/test/macros
  • mv HcalRecHitsHarvestingME.root pi50scanXXXXXXX_ECALHCAL_CaloTowers.root
    • (XXX - any meaningful field to be shown in the histos legend)
  • ./RunPions.csh XXX YYY true
    • (assuming you have pi50scanXXX_ECALHCAL_CaloTowers.root and pi50scanYYY_ECALHCAL_CaloTowers.root histo files to be compared)
    • the resulting directory XXX_vs_YYY_SinglePi contains a webpage with all the pictures

Getting the scale factors (an example)

In CMSSW_5_2_0, eta-dependent scale factors have been added to the HF simulation.
Those had been calculated by adding the following lines to Validation/CaloTowers/test/macros/SinglePi.C

  TCanvas *myc2 = new TCanvas("myc2","",800,600);

  TProfile* ratio2 = f2_prof[5]->Clone();
  ratio2->Divide(f1_prof[5]);
  ratio2->SetMaximum(1.2);
  ratio2->SetMinimum(0.8);
  myc2->SetGrid();
  ratio2->Draw("hist pl");

  TLegend *leg = new TLegend(0.20, 0.91, 0.70, 0.99, "","brNDC");
  leg->SetBorderSize(2);
  leg->SetFillStyle(1001);
  leg->AddEntry(ratio2,"CaloTowers scale (pi50) ratio "+val_vers+"/"+ref_vers+" vs ieta","pl");
  leg->Draw("");

  myc2->SaveAs("Ratio2.gif");
  cout << "###### Ratio vs ieta: " << endl;
  for (int index = 0; indexGetNbinsX(); index++) {
    int ieta = index-41;
    if (abs(ieta)>=30) cout << "ieta="<< ieta << " - ratio = " << ratio2->GetBinContent(index) << endl;
  }

Note: each ieta index must be converted into an eta interval. In FastSimulation/Calorimetry/src/HCALResponse.cc a binning Δη=0.1 is used from |η|=0 to |η|=5.2

Practical recipe to tune at SimHit level

The code, by Kevin Pedro, is available here

Documentation is in the doc directory

Validating with standard events at jets level

Once you are satisfied with the agreement at RecHit or SimHit level, you should check the effect at jets level with the standard validation tools.

First of all, produce some relval-like ttbar events with cmsDriver:

cmsDriver.py TTbar_Tauola_7TeV_cfi.py -s GEN,FASTSIM,HLT:GRun --pileup=NoPileUp --geometry DB --conditions=auto:startup --eventcontent=FEVTDEBUGHLT --datatier GEN-SIM-DIGI-RECO -n 1000 --no_exec

Then, run the standard jets validation (courtesy of Kittikul Kovitanggoon):

  • cvs co Validation/RecoJets; scram b
  • cd Validation/RecoJets/analysis
  • cmsRun allJets_validation_cfg.py
    • Make sure that a recommended GT is used (link)
    • This produces a DQM histogram file
  • ./validation.sh
    • enter Reference.root New.root title (normalization by area) or Reference.root New.root title y (normalization by yield)
    • note: the architecture is hard-coded in this script, in case it doesn't match the SCRAM_ARCH of your release it has to be fixed by hand

In alternative to the last step, over this DQM file you can run a slimmer macro that just compares the jet response (raw pt / gen pt) as a function of eta, for calo and PF jets.

-- AndreaGiammanco - 08-Mar-2012

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r7 - 2014-07-14 - KevinPedro
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback