+++ /dev/null
-void AliKStarAnalysis
-(
- const char *path = "/home/pulvir/resonances/aliroot-v4-04-Rev-08/pythia/selections",
- Double_t ptMin = 0.0,
- Double_t ptMax = 0.0
-)
-{
- gSystem->Load("libPWG2.so");
-
- TChain *tree = new TChain("selection");
-
- // Open the working directory
- void *dirp = gSystem->OpenDirectory(path);
- const char *name = 0x0;
-
- // Add all files matching *pattern* to the chain
- while((name = gSystem->GetDirEntry(dirp))) {
- if (strstr(name, ".root")) {
- cout << "Adding " << name << endl;
- tree->Add(Form("%s/%s", path, name));
- }
- }
- gSystem->FreeDirectory(dirp);
-
- // assign working parameters
- AliRsnAnalysis *analysis = new AliRsnAnalysis;
- analysis->SetEventsTree(tree);
- if (ptMin < ptMax && ptMax != 0.0) {
- analysis->SetPtBin(ptMin, ptMax);
- }
-
- // set histogram bins
- analysis->SetBins(300, 0.5, 2.0); // 300 bins of 5 MeV each
- analysis->SetTrueMotherPDG(313); // PDG code of K*
-
- // import all useful combinations
- analysis->AddPairDef(AliPID::kPion, '+', AliPID::kKaon, '-');
- analysis->AddPairDef(AliPID::kPion, '-', AliPID::kKaon, '+');
- analysis->AddPairDef(AliPID::kPion, '+', AliPID::kKaon, '-', kTRUE);
- analysis->AddPairDef(AliPID::kPion, '-', AliPID::kKaon, '+', kTRUE);
-
- analysis->AddMixPairDef(AliPID::kPion, '+', AliPID::kKaon, '-');
- analysis->AddMixPairDef(AliPID::kPion, '-', AliPID::kKaon, '+');
- analysis->AddMixPairDef(AliPID::kKaon, '-', AliPID::kPion, '+');
- analysis->AddMixPairDef(AliPID::kKaon, '+', AliPID::kPion, '-');
-
- // process data for signal event in same event
- analysis->Process();
- analysis->EventMix(5, 5, 0.02, kFALSE);
-
- // open output file
- TFile *outFile = 0;
- if (ptMin == ptMax && ptMin == 0.) {
- outFile = TFile::Open("kstar.invmass.root", "RECREATE");
- }
- else {
- outFile = TFile::Open(Form("kstar.invmass.pt%3.1f-%3.1f.root", ptMin, ptMax), "RECREATE");
- }
-
- // write histograms
- analysis->WriteHistograms();
-
- outFile->Close();
-}
+++ /dev/null
-void AliLambdaStarAnalysis
-(
- Int_t nevents = 650,
- const char *path_in = "myselection",
- const char *file_out = "lambda.invmass.root"
-)
-{
- gSystem->Load("libANALYSIS.so");
-
- TChain *tree = new TChain("selection");
-
- if (nevents <= 0) {
- // Open the working directory
- void *dirp = gSystem->OpenDirectory(Form("$HOME/lambda/%s", path_in));
- const char *name = 0x0;
- while((name = gSystem->GetDirEntry(dirp))) {
- if (strstr(name, ".root")) {
- tree->Add(Form("$HOME/lambda/%s/%s", path_in, name));
- }
- }
- gSystem->FreeDirectory(dirp);
- }
- else {
- for (Int_t iev = 0; iev <= nevents; iev++) {
- tree->Add(Form("$HOME/lambda/%s/%d.root", path_in, iev));
- }
- }
- cout << "# events: " << tree->GetEntries() << endl;
-
- //AliRsnDaughterCutPtSingle *cutproton = new AliRsnDaughterCutPtSingle(0, 1);
- //AliRsnDaughterCutPtSingle *cutkaon = new AliRsnDaughterCutPtSingle(0, 1);
-
- // assign working parameters
- AliRsnAnalysis *analysis = new AliRsnAnalysis;
- analysis->SetEventsTree(tree);
-
- //analysis->AddCutSingle(AliPID::kProton, cutproton);
- //analysis->AddCutSingle(AliPID::kKaon, cutkaon);
-
- // set histogram bins
- analysis->SetBins(800, 1.3, 2.1); // 700 bins of 1 MeV each
- analysis->SetTrueMotherPDG(3124); // PDG code of Lambda*
-
- // import all useful combinations
-
- analysis->AddPairDef(AliPID::kProton, '+', AliPID::kKaon, '-');
- analysis->AddPairDef(AliPID::kProton, '-', AliPID::kKaon, '+');
- analysis->AddPairDef(AliPID::kProton, '+', AliPID::kKaon, '-', kTRUE);
- analysis->AddPairDef(AliPID::kProton, '-', AliPID::kKaon, '+', kTRUE);
-
- analysis->AddMixPairDef(AliPID::kProton, '+', AliPID::kKaon, '-');
- analysis->AddMixPairDef(AliPID::kProton, '-', AliPID::kKaon, '+');
- analysis->AddMixPairDef(AliPID::kKaon, '-', AliPID::kProton, '+');
- analysis->AddMixPairDef(AliPID::kKaon, '+', AliPID::kProton, '-');
-
-
-
- // process data for signal event in same event
- analysis->Process();
- analysis->EventMix(5, 5, 0.02, kFALSE);
- // open output file
- TFile *outFile = 0;
- outFile = TFile::Open(file_out, "RECREATE");
-
- // write histograms
- analysis->WriteHistograms();
-
- outFile->Close();
-}
+++ /dev/null
-//=========================================================================
-// This macro loops on the entries of a TChain (argument) containing ESDs
-// and saves a file containing a TTree of AliRsnEvents.
-//=========================================================================
-
-void AliRsnReadTask(TChain *analysisChain)
-{
- // load libraries
- gSystem->Load("libANALYSIS");
- gSystem->Load("libANALYSISalice.so");
- gSystem->Load("libPWG2resonances.so");
-
- // instantiate the analysis manager
- AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
-
- // create and connect containers for input/output
- AliAnalysisDataContainer *input = mgr->CreateContainer("in", TChain::Class(), AliAnalysisManager::kInputContainer);
- AliAnalysisDataContainer *output = mgr->CreateContainer("out", TTree::Class(), AliAnalysisManager::kOutputContainer, "default");
- input->SetData(analysisChain);
-
- // add interface to MC
- AliMCEventHandler* mcHandler = new AliMCEventHandler();
- mgr->SetMCtruthEventHandler(mcHandler);
-
- // add interface to ESD
- AliESDInputHandler *esdHandler = new AliESDInputHandler();
- esdHandler->SetInactiveBranches("*Calo*");
- esdHandler->SetInactiveBranches("*V0*");
- mgr->SetInputEventHandler(esdHandler);
-
- // output
- AliAODHandler* aodHandler = new AliAODHandler();
- aodHandler->SetOutputFileName("AliRsnEvents.root");
- aodHandler->SetCreateNonStandardAOD();
- mgr->SetOutputEventHandler(aodHandler);
-
- /*
- // standard track cuts for primaries
- AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts", "Standard");
- esdTrackCutsL->SetMinNClustersTPC(50);
- esdTrackCutsL->SetMaxChi2PerClusterTPC(3.5);
- esdTrackCutsL->SetMaxCovDiagonalElements(2, 2, 0.5, 0.5, 2);
- esdTrackCutsL->SetRequireTPCRefit(kTRUE);
- esdTrackCutsL->SetMinNsigmaToVertex(3);
- esdTrackCutsL->SetRequireSigmaToVertex(kTRUE);
- esdTrackCutsL->SetAcceptKingDaughters(kFALSE);
-
- // create filter for tracks and add to analysis
- AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
- trackFilter->AddCuts(esdTrackCuts);
- AliAnalysisTaskESDfilter *esdfilter = new AliAnalysisTaskESDfilter("ESD Filter");
- esdfilter->SetTrackFilter(trackFilter);
- //esdfilter->SetDebugLevel(10);
- mgr->AddTask(esdfilter);
- */
-
- // create readerTask
- AliRsnReaderTask *task = new AliRsnReaderTask("AliRsnReaderTask");
-
- // Reader settings
- AliRsnReader *reader = new AliRsnReader();
- task->SetReader(reader);
-
- // PID settings
- AliRsnPID *pid = new AliRsnPID;
- pid->SetMethod(AliRsnPID::kPerfect);
- pid->SetPriorProbability(AliRsnPID::kElectron, 0.20);
- pid->SetPriorProbability(AliRsnPID::kMuon, 0.20);
- pid->SetPriorProbability(AliRsnPID::kPion, 0.83);
- pid->SetPriorProbability(AliRsnPID::kKaon, 0.07);
- pid->SetPriorProbability(AliRsnPID::kProton, 0.06);
- pid->SetMaxPt(10.0);
- pid->SetMinProb(0.5);
- task->SetPID(pid);
-
- // connect containers to AnalysisManager
- mgr->AddTask(task);
- mgr->ConnectInput(task, 0, input);
- mgr->ConnectOutput(task, 0, output);
-
- // run analysis
- if (mgr->InitAnalysis()) {
- mgr->PrintStatus();
- mgr->StartAnalysis("rsnEvents", analysisChain);
- }
-}
+++ /dev/null
-void AliRsnReadTaskAlien
-(
- const char *kCollectionFile="wn.xml", // XML file containing tags
- Long64_t nentries=TChain::kBigNumber
-)
-{
- // connect to grid
- TGrid::Connect("alien://");
-
- // create chain of files to read
- TAlienCollection *myCollection = TAlienCollection::Open(kCollectionFile);
- if (!myCollection) {
- Error("AliRsnReadTaskRL", Form("Cannot create an AliEn collection from %s", kCollectionFile));
- return;
- }
- TChain* analysisChain = new TChain("esdTree");
- myCollection->Reset();
-
- // loop on the entries of the XML input file
- Int_t i = 0;
- while ( myCollection->Next() ) {
- char esdFile[255];
- sprintf(esdFile, "%s", myCollection->GetTURL(""));
- Info("AliRsnReadTaskRL", Form("Adding %s", esdFile));
- analysisChain->Add(esdFile);
- if (++i >= 1) break;
- }
- Info("AliRsnReadTaskRL", Form("CHAIN HAS %d ENTRIES", (Int_t)analysisChain->GetEntries()));
-
- // load read macro
- gROOT->LoadMacro("$(ALICE_ROOT)/PWG2/RESONANCES/macros/AliRsnReadTask.C");
- AliRsnReadTask(analysisChain);
-}
\ No newline at end of file
+++ /dev/null
-//=========================================================================
-// This macro loops on the entries of a TChain (argument) containing ESDs
-// and saves a file containing a TTree of AliRsnEvents.
-//=========================================================================
-
-void AliRsnReadTaskLocal()
-{
- // by default, assume that a file named "AliESDs.root"
- // exists in the working directory and connects to it
- TChain *analysisChain = new TChain("esdTree");
- analysisChain->Add("AliESDs.root");
-
- // load read macro
- TString str(getenv("ALICE_ROOT"));
- str.Append("/PWG2/RESONANCES/macros/AliRsnReadTask.C");
- gROOT->LoadMacro(str.Data());
-
- AliRsnReadTask(analysisChain);
-}
+++ /dev/null
-void AliRsnSelect
-(
- Int_t event = 1,
- Option_t *inRootPath = "/home/pulvir/resonances/aliroot-v4-04-Rev-08/pythia/events",
- Option_t *outRootPath = "/home/pulvir/resonances/aliroot-v4-04-Rev-08/pythia/selections",
- Double_t ptLimit4PID = 10000.0
-)
-{
- // load ANALYSIS library for output objects
- gSystem->Load("libPWG2.so");
-
- // instantiate reading manager
- AliRsnReader *reader = new AliRsnReader;
-
- // Define prior probabilities (only for ESD PID)
- reader->SetPriorProbability(AliPID::kElectron, 0.0339947); //0.0339947
- reader->SetPriorProbability(AliPID::kMuon, 0.0192307); //0.0192307
- reader->SetPriorProbability(AliPID::kPion, 0.822957); //0.822957
- reader->SetPriorProbability(AliPID::kKaon, 0.0751355); //0.0751355
- reader->SetPriorProbability(AliPID::kProton, 0.0486821); //0.0486821
- reader->SetProbabilityThreshold(0.5);
-
- // Define PID method
- reader->SetPIDMethod(AliRsnReader::kPerfectPID);
-
- // create input/output names
- Text_t inPath[200], outFileName[200];
- sprintf(inPath, "%s/%d", inRootPath, event);
- sprintf(outFileName, "%s/%d.root", outRootPath, event);
-
- // do event reading
- cout << "Reading data in " << inPath << endl;
- TTree *events = reader->ReadTracksAndParticles(inPath, "R");
- if (!events) return;
- cout << endl;
-
- // open output file
- TFile *fileOut = TFile::Open(outFileName, "RECREATE");
- cout << "Saving data in " << outFileName << endl;
- events->Write(events->GetName(), TObject::kOverwrite);
- fileOut->Close();
-}
+++ /dev/null
-#include "Riostream.h"
-#include "TChain.h"
-
-void CreateXML(const char *name, Int_t from, Int_t to, const char *path)
-{
- const char *fixed1 = "<file name=\"AliESDs.root\" aclId=\"\" ctime=\"2006-08-14 17:17:43\" dir=\"2736575\" entryId=\"2736577\" expiretime=\"\" gowner=\"aliprod\" guid=\"0096DCE6-F62B-14DE-97BF-5519E793BEEF\"";
- const char *fixed2 = "md5=\"aaa\" owner=\"pulvir\" perm=\"755\" replicated=\"0\" seStringlist=\",72,\" size=\"19050411\"";
-
- char fileName[100];
- sprintf(fileName, "%s.xml", name);
- fstream file(fileName, ios::out);
-
- // header
- file << "<?xml version=\"1.0\"?>" << endl;
- file << "<alien>" << endl;
- file << "\t<collection name=\"" << name << "\">" << endl;
-
- // events
- for (int i = from; i <= to; i++) {
- file << "\t\t<event name=\"" << i << "\">" << endl;
- file << "\t\t\t" << fixed1 << " ";
- file << "lfn=\"" << path << "/" << i << "/AliESDs.root\" ";
- file << fixed2 << " turl=\"" << path << "/" << i << "/AliESDs.root\" type=\"f\" />" << endl;
- file << "\t\t</event>" << endl;
- }
-
- // footer
- file << "\t</collection>" << endl;
- file << "</alien>" << endl;
- file.close();
-}
-
-Bool_t AliRsnSelectRL
-(
- Int_t first_event = 1,
- Int_t last_event = 10,
- const char * path = "/home/pulvir/events/head-2006-11-22/hijing",
- const char * chainName = "esdTree",
- Long64_t nentries = TChain::kBigNumber
-)
-{
- gSystem->SetIncludePath("-I. -I$ALICE_ROOT/include -I$ALICE_ROOT/PWG0/ -I$ROOTSYS/include -I$ALICE_ROOT/PWG2/RESONANCES");
- gSystem->Load("libXMLIO.so");
- gSystem->Load("libRAliEn.so");
- gSystem->Load("libPWG2.so");
-
- // Create automatically the XML collection
- char collection[255], collectionFile[255];
- sprintf(collection, "local_%d-%d", first_event, last_event);
- sprintf(collectionFile, "local_%d-%d.xml", first_event, last_event);
- CreateXML(collection, first_event, last_event, path);
-
- Info("Run", Form("Creating the collection from %s", collectionFile));
- TAlienCollection * myCollection = new TAlienCollection(collectionFile);
- if (!myCollection) {
- Error("Run", Form("Cannot create an AliEn collection from %s", collectionFile));
- return kFALSE;
- }
-
- Info("Run", Form("Creating the analysis chain %s", chainName));
- TChain* analysisChain = new TChain(chainName);
-
- Info("Run", "Preparing the file list");
- myCollection->Reset();
- while ( myCollection->Next() ) {
- char esdFile[255];
- sprintf(esdFile, "%s", myCollection->GetTURL(""));
- Info("Run", Form("Adding %s", esdFile));
- analysisChain->Add(esdFile);
- }
-
- Info("Run", "Setting parameters to selector...");
- AliRsnSelectorRL* selector = new AliRsnSelectorRL;
- selector->SetDebugFlag(kFALSE);
- selector->SetStoreKineInfo(1);
- selector->SetCheckITSRefit(1);
- selector->SetRejectFakes(0);
- selector->SetCopyMomentum(0);
-
- // Define prior probabilities (only for ESD PID)
- selector->SetPriorProbability(AliPID::kElectron, 0.042);
- selector->SetPriorProbability(AliPID::kMuon, 0.124);
- selector->SetPriorProbability(AliPID::kPion, 0.655);
- selector->SetPriorProbability(AliPID::kKaon, 0.041);
- selector->SetPriorProbability(AliPID::kProton, 0.130);
-
- // Define PID method
- selector->SetPIDMethod(AliRsnSelectorRL::kPerfectPID); // kESDPID or kPerfectPID
-
- // Set output file name
- selector->SetOutputFile(Form("selection_%d-%d.root", first_event, last_event));
-
- // Process the chain
- Info("Run", "Processing the chain...");
- analysisChain->Process(selector, chainName, nentries, 0);
-
- return kTRUE;
-}
+++ /dev/null
-#include <Riostream.h>
-#include <TMath.h>
-#include <TH1.h>
-#include <TF1.h>
-#include <TFile.h>
-#include <TCanvas.h>
-#include <TStyle.h>
-
-Double_t bw(Double_t *x, Double_t *par)
-{
- // Fit parameters:
- // par[0] = normalization factor
- // par[1] = peak position
- // par[2] = FWHM
-
- return par[0] * TMath::BreitWigner(x[0], par[1], par[2]);
-}
-
-Double_t bwgaus(Double_t *x, Double_t *par)
-{
- // Fit parameters:
- // par[0] = global normalization constant
- // par[1] = BW peak position
- // par[2] = FWHM
- // par[3] = sigma of convoluted gaussian
-
- // Numeric constants
- Double_t invsq2pi = 0.3989422804014; // (2 pi)^(-1/2)
-
- // Control constants
- Double_t nsteps = 100.0; // number of convolution steps
- Double_t nsigma = 3.0; // convolution extends to +-sc Gaussian sigmas
-
- // Range of convolution integral
- Double_t x1 = x[0] - nsigma * par[3];
- Double_t x2 = x[0] + nsigma * par[3];
- Double_t dx = (x2 - x1) / nsteps;
-
- // Variables
- Double_t i, xx, fbw, fgaus, sum = 0.0;
-
- // Convolution integral of Breit-Wigner and Gaussian by sum
- for(i = 1.0; i <= 0.5 * nsteps; i++) {
-
- xx = x1 + (i - 0.5) * dx;
- fbw = TMath::BreitWigner(xx, par[1], par[2]);
- fgaus = TMath::Gaus(x[0], xx, par[3]);
- sum += fbw * fgaus;
-
- xx = x2 - (i - 0.5) * dx;
- fbw = TMath::BreitWigner(xx, par[1], par[2]);
- fgaus = TMath::Gaus(x[0], xx, par[3]);
- sum += fbw * fgaus;
-
- }
-
- return (par[0] * dx * sum * invsq2pi / par[3]);
-}
-
-Double_t bwgaus_line(Double_t *x, Double_t *par)
-{
- Double_t bwg = bwgaus(x, par);
- return bwg + par[4] + par[5] * x[0];
-}
-
-void view
-(Int_t rebin = 8, Double_t mult = 4.0, Double_t fitmin = 0.7, Double_t fitmax = 0.8,
- const char *filename = "kstar.invmass.root")
-{
- TFile *f = TFile::Open(filename);
-
- TH1D * hsign = (TH1D*)f->Get("h_Pi(+)_K(-)");
- TH1D * hsign_2 = (TH1D*)f->Get("h_Pi(-)_K(+)");
-
- TH1D * hmix = (TH1D*)f->Get("hmix_Pi(+)_K(-)");
- TH1D * hmix_2 = (TH1D*)f->Get("hmix_Pi(-)_K(+)");
- TH1D * hmix_3 = (TH1D*)f->Get("hmix_K(+)_Pi(-)");
- TH1D * hmix_4 = (TH1D*)f->Get("hmix_K(-)_Pi(+)");
-
- TH1D * htrue = (TH1D*)f->Get("h_Pi(+)_K(-)_true");
- TH1D * htrue_2 = (TH1D*)f->Get("h_Pi(-)_K(+)_true");
-
- hsign->Rebin(rebin);
- hsign_2->Rebin(rebin);
-
- htrue->Rebin(rebin);
- htrue_2->Rebin(rebin);
-
- hmix->Rebin(rebin);
- hmix_2->Rebin(rebin);
- hmix_3->Rebin(rebin);
- hmix_4->Rebin(rebin);
-
- hsign->Add(hsign_2);
- htrue->Add(htrue_2);
-
- hmix->Add(hmix_2);
- hmix->Add(hmix_3);
- hmix->Add(hmix_4);
-
- hsign->Sumw2();
- hmix->Sumw2();
- htrue->Sumw2();
-
- cout << "# signal entries: " << hsign->Integral() << endl;
- cout << "# backgr. entries: " << hmix->Integral() << endl;
- cout << "# true pairs: " << htrue->Integral() << endl;
-
- // mean and width of lambda*
- Double_t mean = 0.896;
- Double_t gamma = 0.05;
-
- // find bin limits for fit
- Int_t b1 = hsign->GetXaxis()->FindFixBin(fitmin);
- Int_t b2 = hsign->GetXaxis()->FindFixBin(fitmax);
- hmix->Scale( hsign->Integral(b1, b2) / hmix->Integral(b1, b2) );
-
- // drawing options
- gStyle->SetOptStat(0);
- gROOT->SetStyle("Plain");
-
- // draw signal and background together
- TCanvas *c1 = new TCanvas("c1", "", 0, 0, 640, 480);
- TH1D *hsign1 = (TH1D*)hsign->Clone();
- TH1D *hmix1 = (TH1D*)hmix->Clone();
- hsign1->GetXaxis()->SetTitle("Inv. mass (GeV/c^{2})");
- hsign1->GetYaxis()->SetTitle("counts");
- hsign1->SetTitle("");
- hsign1->SetMarkerStyle(8);
- hsign1->SetMarkerSize(0.8);
- hsign1->SetStats(0);
- hsign1->Draw("PE");
- //hmix1->SetLineColor(kRed);
- hmix1->SetMarkerStyle(4);
- hmix1->SetStats(0);
- hmix1->GetXaxis()->SetTitle("Inv. mass (GeV/c^{2})");
- hmix1->GetYaxis()->SetTitle("counts");
- hmix1->Draw("CESAME");
- c1->Update();
-
- // draw subtraction and fit with BW+gaus
- TCanvas *c2 = new TCanvas("c2", "", 50, 50, 640, 480);
- TH1D *hdiff = (TH1D*)hsign1->Clone();
- hdiff->Add(hmix, -1.0);
- hdiff->GetXaxis()->SetRangeUser(mean - mult*gamma, mean + mult*gamma);
-// TF1 *fcn = new TF1("fcn", bwgaus_line, mean - mult*gamma, mean + mult*gamma, 6);
- TF1 *fcn = new TF1("fcn", bwgaus, mean - mult*gamma, mean + mult*gamma, 4);
- fcn->SetParameter(0, hdiff->GetMaximum() * 0.6);
- fcn->SetParameter(1, mean);
- fcn->SetParameter(2, gamma);
- fcn->SetParameter(3, 0.001);
-// fcn->SetParameter(4, 20);
-// fcn->SetParameter(5, -50);
-// fcn->SetParNames("Constant", "BW_peak", "BW_gamma", "Gaus_sigma", "Line_A", "Line_B");
- fcn->SetParNames("Constant", "BW_peak", "BW_gamma", "Gaus_sigma");
- fcn->SetLineColor(kGreen);
-// hdiff->Fit(fcn, "RE");
- hdiff->SetStats(0);
- hdiff->GetXaxis()->SetTitle("Inv. mass (GeV/c^{2})");
- hdiff->GetYaxis()->SetTitle("counts");
- hdiff->Draw("PE");
- cout << "Fit results: " << endl;
- cout << "Peak center: " << fcn->GetParameter(1) << " +/- " << fcn->GetParError(1) << endl;
- cout << "Peak width : " << fcn->GetParameter(2) << " +/- " << fcn->GetParError(2) << endl;
- cout << "Gaus sigma : " << fcn->GetParameter(3) << " +/- " << fcn->GetParError(3) << endl;
- c2->Update();
-
- // draw true pairs
- TCanvas *c3 = new TCanvas("c3", "", 100, 100, 640, 480);
- TH1D *htrue1 = (TH1D*)htrue->Clone();
- htrue1->SetMarkerStyle(21);
- htrue1->SetMarkerColor(kRed);
- htrue1->GetXaxis()->SetRangeUser(mean - mult*gamma, mean + mult*gamma);
- htrue1->SetStats(0);
- htrue1->GetXaxis()->SetTitle("Inv. mass (GeV/c^{2})");
- htrue1->GetYaxis()->SetTitle("counts");
- htrue1->Draw("PE");
- c3->Update();
-
- // draw true pairs with diff
- TCanvas *c4 = new TCanvas("c4", "", 150, 150, 640, 480);
- hdiff->Draw("PE");
- htrue1->SetMarkerStyle(4);
- htrue1->SetMarkerColor(1);
- htrue1->Draw("PEsame");
- c4->Update();
-
- // print true and reconstructed pairs
- b1 = htrue->GetXaxis()->FindFixBin(mean - 1.5*gamma);
- b2 = htrue->GetXaxis()->FindFixBin(mean + 1.5*gamma);
- TF1 *fbw = new TF1("fbw", bw, mean - mult*gamma, mean + mult*gamma, 3);
- fbw->SetParameter(0, fcn->GetParameter(0));
- fbw->SetParameter(1, fcn->GetParameter(1));
- fbw->SetParameter(2, fcn->GetParameter(2));
- Double_t S = htrue->Integral(b1, b2);
- Double_t B = hsign->Integral(b1, b2);
- cout << "True pairs: " << S << endl;
- cout << "Reconstructed: " << fbw->Integral(mean - 1.5*gamma, mean + 1.5*gamma) / htrue->GetBinWidth(1) << endl;
- cout << "Background pairs: " << B << endl;
- cout << "S/B (+/- 1.5 G): " << S / B << endl;
- cout << "sign. (+/- 1.5 G): " << S / TMath::Sqrt(S + B) << endl;
-
- // save pictures
- Text_t answer;
- cout << "Save canvases as eps files (y/n)? ";
- cin >> answer;
- if (answer == 'y' || answer == 'Y') {
- c1->SaveAs("lambda_sign_bg.eps");
- c2->SaveAs("lambda_diff.eps");
- c3->SaveAs("lambda_true.eps");
- c4->SaveAs("lambda_comparison.eps");
- }
-}
-