Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:19

0001 void TestCorrections(double rawPt, double rawEta, double rawPhi, double rawE, double JPTE, int NPV) {
0002   gROOT->ProcessLine("#include <vector>");
0003   gSystem->Load("libFWCoreFWLite.so");
0004   FWLiteEnabler::enable();
0005   ////////////// Construct the JetCorrectorParameters objects ///////////////////////
0006   string L1Tag = "../data/Jec11V0_L1Offset_AK5JPT.txt";
0007   string L1JPTTag = "../data/Jec11V0_L1JPTOffset_AK5JPT.txt";
0008   JetCorrectorParameters *L1Par = new JetCorrectorParameters(L1Tag);
0009   JetCorrectorParameters *L1JPTPar = new JetCorrectorParameters(L1JPTTag);
0010   vector<JetCorrectorParameters> vPar;
0011   vPar.push_back(*L1Par);
0012   vPar.push_back(*L1JPTPar);
0013   ////////////// Construct a FactorizedJetCorrector object //////////////////////
0014   FactorizedJetCorrector *JetCorrector = new FactorizedJetCorrector(vPar);
0015   ////////////// Loop over jets //////////////////////
0016   TLorentzVector rawJetP4;
0017   rawJetP4.SetPtEtaPhiE(rawPt, rawEta, rawPhi, rawE);
0018   JetCorrector->setJPTrawP4(rawJetP4);
0019   JetCorrector->setJetE(JPTE);
0020   JetCorrector->setNPV(NPV);
0021   vector<float> vcor;
0022   vcor = JetCorrector->getSubCorrections();
0023   cout << "Correction applied to JPT jet after L1Offset = " << vcor[0] << endl;
0024   cout << "Correction applied to JPT jet after L1JPTOffset = " << vcor[1] << endl;
0025 }