average multiplicity
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 28 May 2008 15:20:58 +0000 (15:20 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 28 May 2008 15:20:58 +0000 (15:20 +0000)
phojet/gqsm comparison

PWG0/dNdEta/drawPlots.C
PWG0/dNdEta/drawSystematics.C
PWG0/dNdEta/drawSystematicsNew.C

index 84e351d..2b944a2 100644 (file)
@@ -1779,3 +1779,21 @@ void DetermineAcceptance(const char* fileName = "correction_map.root", const cha
   Printf("End array (mirrored) (should be the same):");
   Printf("%s", arrayEnd.Data());
 }
+
+void AverageMultiplicity(const char* fileName = "correction_map.root", const char* correctionMapFolder = "dndeta_correction")
+{
+  loadlibs();
+
+  TFile::Open(fileName);
+
+  AlidNdEtaCorrection* dNdEtaCorrection = new AlidNdEtaCorrection(correctionMapFolder, correctionMapFolder);
+  dNdEtaCorrection->LoadHistograms();
+  TH2* events = dNdEtaCorrection->GetTriggerBiasCorrectionINEL()->GetEventCorrection()->GetGeneratedHistogram();
+  TH3* tracks = dNdEtaCorrection->GetTriggerBiasCorrectionINEL()->GetTrackCorrection()->GetGeneratedHistogram();
+
+  Float_t nEvents = events->Integral(events->GetXaxis()->FindBin(-1), events->GetXaxis()->FindBin(1), 0, events->GetNbinsY()+1);
+  Float_t nTracks = tracks->Integral(tracks->GetXaxis()->FindBin(-1), tracks->GetXaxis()->FindBin(1), tracks->GetYaxis()->FindBin(-0.39), tracks->GetYaxis()->FindBin(0.59), 0, tracks->GetNbinsZ()+1);
+
+  Printf("%f %f --> %f", nEvents, nTracks, nTracks / nEvents);
+}
+
index 97dd60e..9854f6f 100644 (file)
@@ -796,9 +796,20 @@ mergeCorrectionsWithDifferentCrosssections(Char_t* correctionFileName="correctio
   loadlibs();
 
   const Char_t* typeName[] = { "vertexreco", "trigger", "vtxtrigger" };
+
+  /*
   const Char_t* changes[]  = { "pythia","ddmore","ddless","sdmore","sdless", "dmore", "dless", "sdmoreddless", "sdlessddmore", "ddmore25","ddless25","sdmore25","sdless25", "dmore25", "dless25", "sdmoreddless25", "sdlessddmore25"};
+  // add scalesND!!!
   Float_t scalesDD[] = {1.0, 1.5, 0.5, 1.0, 1.0, 1.5, 0.5, 1.5, 0.5, 1.25, 0.75, 1.0,  1.0,  1.25, 0.75, 1.25, 0.75};
   Float_t scalesSD[] = {1.0, 1.0, 1.0, 1.5, 0.5, 1.5, 0.5, 0.5, 1.5, 1.0,  1.0,  1.25, 0.75, 1.25, 0.75, 0.75, 1.25};
+  Int_t nChanges = 17;
+  */
+
+  const Char_t* changes[]  = { "pythia", "qgsm", "phojet"};
+  Float_t scalesND[] = {1.0, 1.10, 1.11};
+  Float_t scalesSD[] = {1.0, 0.69, 0.86};
+  Float_t scalesDD[] = {1.0, 0.98, 0.61};
+  Int_t nChanges = 3;
 
   // cross section from Pythia
   Float_t sigmaND = 55.2;
@@ -823,7 +834,7 @@ mergeCorrectionsWithDifferentCrosssections(Char_t* correctionFileName="correctio
   Int_t counter = 0;
   for (Int_t j=0; j<3; j++) { // j = 0 (change vtx), j = 1 (change trg), j = 2 (change both)
 
-    for (Int_t i=0; i<17; i++) {
+    for (Int_t i=0; i<nChanges; i++) {
       TFile::Open(correctionFileName);
 
       TString name;
@@ -854,17 +865,21 @@ mergeCorrectionsWithDifferentCrosssections(Char_t* correctionFileName="correctio
       // scale
       if (j == 0 || j == 2)
       {
+        dNdEtaCorrectionND->GetVertexRecoCorrection()->Scale(scalesND[i]);
         dNdEtaCorrectionDD->GetVertexRecoCorrection()->Scale(scalesDD[i]);
         dNdEtaCorrectionSD->GetVertexRecoCorrection()->Scale(scalesSD[i]);
       }
       if (j == 1 || j == 2)
       {
+        dNdEtaCorrectionND->GetTriggerBiasCorrectionINEL()->Scale(scalesND[i]);
         dNdEtaCorrectionDD->GetTriggerBiasCorrectionINEL()->Scale(scalesDD[i]);
         dNdEtaCorrectionSD->GetTriggerBiasCorrectionINEL()->Scale(scalesSD[i]);
 
+        dNdEtaCorrectionND->GetTriggerBiasCorrectionNSD()->Scale(scalesND[i]);
         dNdEtaCorrectionDD->GetTriggerBiasCorrectionNSD()->Scale(scalesDD[i]);
         dNdEtaCorrectionSD->GetTriggerBiasCorrectionNSD()->Scale(scalesSD[i]);
 
+        dNdEtaCorrectionND->GetTriggerBiasCorrectionND()->Scale(scalesND[i]);
         dNdEtaCorrectionDD->GetTriggerBiasCorrectionND()->Scale(scalesDD[i]);
         dNdEtaCorrectionSD->GetTriggerBiasCorrectionND()->Scale(scalesSD[i]);
       }
@@ -891,8 +906,8 @@ mergeCorrectionsWithDifferentCrosssections(Char_t* correctionFileName="correctio
       dNdEtaAnalysis* fdNdEtaAnalysis = new dNdEtaAnalysis("fdNdEtaAnalysisESD", "fdNdEtaAnalysisESD");
       fdNdEtaAnalysis->LoadHistograms();
 
-      fdNdEtaAnalysis->Finish(current, 0.3, AlidNdEtaCorrection::kINEL);
-      //fdNdEtaAnalysis->Finish(current, 0.3, AlidNdEtaCorrection::kNSD);
+      //fdNdEtaAnalysis->Finish(current, 0.3, AlidNdEtaCorrection::kINEL, Form("%d %d", j, i));
+      fdNdEtaAnalysis->Finish(current, 0.3, AlidNdEtaCorrection::kNSD);
 
       name = "ratio";
       if (j==0) name.Append("_vetexReco_");
@@ -920,7 +935,7 @@ mergeCorrectionsWithDifferentCrosssections(Char_t* correctionFileName="correctio
   // to make everything consistent
   hRatios[0]->Divide(hRatios[0],hRatios[0],1,1);
 
-  for (Int_t i=0; i<51; i++)
+  for (Int_t i=0; i<nChanges * 3; i++)
   {
     corrections[i]->SaveHistograms();
     hRatios[i]->Write();
index 7dbd80e..0f9aede 100644 (file)
@@ -70,12 +70,14 @@ void DrawEffectOfChangeInCrossSection(const char* fileName) {
   //get the data
   TFile* fin = TFile::Open(fileName);
 
-  const Char_t* changes[]  = {"pythia","ddmore","ddless","sdmore","sdless", "dmore", "dless", "sdmoreddless", "sdlessddmore" };
+  //const Char_t* changes[]  = {"pythia","ddmore","ddless","sdmore","sdless", "dmore", "dless", "sdmoreddless", "sdlessddmore" };
+  const Char_t* changes[]  = { "pythia", "qgsm", "phojet" };
+  const Int_t nChanges = 3;
   //const Char_t* changes[]  = {"pythia","ddmore25","ddless25","sdmore25","sdless25", "dmore25", "dless25", "sdmoreddless25", "sdlessddmore25" };
   Int_t colors[] = {1,1,kRed,kBlue,kGreen,kPink,1,kRed,kBlue};
 
-  TH1F* hRatios[9];
-  for(Int_t i=0; i<9; i++) {
+  TH1F* hRatios[3];
+  for(Int_t i=0; i<nChanges; i++) {
     hRatios[i] = (TH1F*)fin->Get(Form("ratio_vertexReco_triggerBias_%s",changes[i]));
     hRatios[i]->SetLineWidth(2);
     hRatios[i]->SetLineColor(colors[i]);
@@ -95,9 +97,9 @@ void DrawEffectOfChangeInCrossSection(const char* fileName) {
   null->GetYaxis()->SetTitle("Ratio pythia/modified cross-sections");
   null->Draw();
 
-  TLatex* text[9];
+  TLatex* text[3];
 
-  for(Int_t i=1; i<9; i++) {
+  for(Int_t i=1; i<nChanges; i++) {
     hRatios[i]->Draw("same");
     
     TString str(hRatios[i]->GetTitle());