123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- #include "StHbtMaker/Infrastructure/StHbtTrack.hh"
- #include "StHbtMaker/Infrastructure/StHbtTypes.hh"
- #include "StHbtMaker/Cut/trackCutMonitor_TpcNSigma.h"
- #ifdef __ROOT__
- #include <TString.h>
- ClassImp(trackCutMonitor_TpcNSigma)
- #endif
- //_________________
- trackCutMonitor_TpcNSigma::trackCutMonitor_TpcNSigma() {
-
- mCharge = 0;
- mPartType = 0;
- hNSigmaElectron = new TH1F(Form("trackCutMonitor_nSigmaElectron"),
- Form("nSigmaElectron; n#sigma(e); dN/dn#sigma(e)"),
- 40,-10.,10.);
- hNSigmaPion = new TH1F(Form("trackCutMonitor_nSigmaPion"),
- Form("nSigmaPion; n#sigma(#pi); dN/dn#sigma(e)"),
- 40,-10.,10.);
- hNSigmaKaon = new TH1F(Form("trackCutMonitor_nSigmaKaon"),
- Form("nSigmaKaon; n#sigma(K); dN/dn#sigma(e)"),
- 40,-10.,10.);
- hNSigmaProton = new TH1F(Form("trackCutMonitor_nSigmaProton"),
- Form("nSigmaProton; n#sigma(p); dN/dn#sigma(e)"),
- 40, -10., 10.);
- }
-
- //_________________
- trackCutMonitor_TpcNSigma::trackCutMonitor_TpcNSigma(Int_t Charge,
- Int_t PartType) {
- if(Charge<-1. || Charge>1) {
- std::cout << "trackCutMonitor_TpcNSigma: Wrong particle charge: " << Charge
- << " Set it to 0 (all charges)" << std::endl;
- Charge = 0;
- }
- mCharge = Charge;
- if(PartType<0 || PartType>4) {
- std::cout << "trackCutMonitor_TpcNSigma: Wrong particle type: " << PartType
- << " Set it to 0 (all hypotheses)" << std::endl;
- PartType = 0;
- }
- mPartType = PartType; //0-all, 1-elec, 2-pion, 3-kaon, 4-proton
-
- switch(mPartType) {
- case 0:
- hNSigmaElectron = new TH1F(Form("trackCutMonitor_nSigmaElectron"),
- Form("nSigmaElectron charge=%2d; n#sigma(e); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- hNSigmaPion = new TH1F(Form("trackCutMonitor_nSigmaPion"),
- Form("nSigmaPion charge=%2d; n#sigma(#pi); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- hNSigmaKaon = new TH1F(Form("trackCutMonitor_nSigmaKaon"),
- Form("nSigmaKaon charge=%2d; n#sigma(K); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- hNSigmaProton = new TH1F(Form("trackCutMonitor_nSigmaProton"),
- Form("nSigmaProton charge=%2d; n#sigma(p); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- break;
- case 1:
- hNSigmaElectron = new TH1F(Form("trackCutMonitor_nSigmaElectron"),
- Form("nSigmaElectron charge=%2d; n#sigma(e); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- break;
- case 2:
- hNSigmaPion = new TH1F(Form("trackCutMonitor_nSigmaPion"),
- Form("nSigmaPion charge=%2d; n#sigma(#pi); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- break;
- case 3:
- hNSigmaKaon = new TH1F(Form("trackCutMonitor_nSigmaKaon"),
- Form("nSigmaKaon charge=%2d; n#sigma(K); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- break;
- case 4:
- hNSigmaProton = new TH1F(Form("trackCutMonitor_nSigmaProton"),
- Form("nSigmaProton charge=%2d; n#sigma(p); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- break;
- default:
- hNSigmaElectron = new TH1F(Form("trackCutMonitor_nSigmaElectron"),
- Form("nSigmaElectron charge=%2d; n#sigma(e); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- hNSigmaPion = new TH1F(Form("trackCutMonitor_nSigmaPion"),
- Form("nSigmaPion charge=%2d; n#sigma(#pi); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- hNSigmaKaon = new TH1F(Form("trackCutMonitor_nSigmaKaon"),
- Form("nSigmaKaon charge=%2d; n#sigma(K); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- hNSigmaProton = new TH1F(Form("trackCutMonitor_nSigmaProton"),
- Form("nSigmaProton charge=%2d; n#sigma(p); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- };
- }
- //_________________
- trackCutMonitor_TpcNSigma::trackCutMonitor_TpcNSigma(Int_t Charge, Int_t PartType,
- const Char_t* TitCutMoni) {
- if(Charge<-1. || Charge>1) {
- std::cout << "trackCutMonitor_TpcNSigma: Wrong particle charge: " << Charge
- << " Set it to 0 (all charges)" << std::endl;
- Charge = 0;
- }
- mCharge = Charge;
- if(PartType<0 || PartType>4) {
- std::cout << "trackCutMonitor_TpcNSigma: Wrong particle type: " << PartType
- << " Set it to 0 (all hypotheses)" << std::endl;
- PartType = 0;
- }
- mPartType = PartType; //0-all, 1-elec, 2-pion, 3-kaon, 4-proton
- TString title(TitCutMoni);
- switch(mPartType) {
- case 0:
- hNSigmaElectron = new TH1F(title.Data(),
- Form("nSigmaElectron charge=%2d; n#sigma(e); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- hNSigmaPion = new TH1F(title.Data(),
- Form("nSigmaPion charge=%2d; n#sigma(#pi); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- hNSigmaKaon = new TH1F(title.Data(),
- Form("nSigmaKaon charge=%2d; n#sigma(K); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- hNSigmaProton = new TH1F(title.Data(),
- Form("nSigmaProton charge=%2d; n#sigma(p); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- break;
- case 1:
- hNSigmaElectron = new TH1F(title.Data(),
- Form("nSigmaElectron charge=%2d; n#sigma(e); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- break;
- case 2:
- hNSigmaPion = new TH1F(title.Data(),
- Form("nSigmaPion charge=%2d; n#sigma(#pi); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- break;
- case 3:
- hNSigmaKaon = new TH1F(title.Data(),
- Form("nSigmaKaon charge=%2d; n#sigma(K); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- break;
- case 4:
- hNSigmaProton = new TH1F(title.Data(),
- Form("nSigmaProton charge=%2d; n#sigma(p); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- break;
- default:
- hNSigmaElectron = new TH1F(title.Data(),
- Form("nSigmaElectron charge=%2d; n#sigma(e); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- hNSigmaPion = new TH1F(title.Data(),
- Form("nSigmaPion charge=%2d; n#sigma(#pi); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- hNSigmaKaon = new TH1F(title.Data(),
- Form("nSigmaKaon charge=%2d; n#sigma(K); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- hNSigmaProton = new TH1F(title.Data(),
- Form("nSigmaProton charge=%2d; n#sigma(p); dN/dn#sigma(e)", mCharge),
- 40,-10.,10.);
- };
- }
- //_________________
- trackCutMonitor_TpcNSigma::trackCutMonitor_TpcNSigma(Int_t Charge, Int_t PartType,
- const Char_t* TitCutMoni,
- Int_t nBinsNSigma,
- Double_t NSigmaLow,
- Double_t NSigmaHi) {
- if(Charge<-1. || Charge>1) {
- std::cout << "trackCutMonitor_TpcNSigma: Wrong particle charge: " << Charge
- << " Set it to 0 (all charges)" << std::endl;
- Charge = 0;
- }
- mCharge = Charge;
- if(PartType<0 || PartType>4) {
- std::cout << "trackCutMonitor_TpcNSigma: Wrong particle type: " << PartType
- << " Set it to 0 (all hypotheses)" << std::endl;
- PartType = 0;
- }
- mPartType = PartType; //0-all, 1-elec, 2-pion, 3-kaon, 4-proton
- TString title(TitCutMoni);
- Int_t mNBinsX = nBinsNSigma;
- Double_t mBinXLo = NSigmaLow;
- Double_t mBinXHi = NSigmaHi;
- switch(mPartType) {
- case 0:
- hNSigmaElectron = new TH1F(title.Data(),
- Form("nSigmaElectron charge=%2d; n#sigma(e); dN/dn#sigma(e)", mCharge),
- mNBinsX, mBinXLo, mBinXHi);
- hNSigmaPion = new TH1F(title.Data(),
- Form("nSigmaPion charge=%2d; n#sigma(#pi); dN/dn#sigma(e)", mCharge),
- mNBinsX, mBinXLo, mBinXHi);
- hNSigmaKaon = new TH1F(title.Data(),
- Form("nSigmaKaon charge=%2d; n#sigma(K); dN/dn#sigma(e)", mCharge),
- mNBinsX, mBinXLo, mBinXHi);
- hNSigmaProton = new TH1F(title.Data(),
- Form("nSigmaProton charge=%2d; n#sigma(p); dN/dn#sigma(e)", mCharge),
- mNBinsX, mBinXLo, mBinXHi);
- break;
- case 1:
- hNSigmaElectron = new TH1F(title.Data(),
- Form("nSigmaElectron charge=%2d; n#sigma(e); dN/dn#sigma(e)", mCharge),
- mNBinsX, mBinXLo, mBinXHi);
- break;
- case 2:
- hNSigmaPion = new TH1F(title.Data(),
- Form("nSigmaPion charge=%2d; n#sigma(#pi); dN/dn#sigma(e)", mCharge),
- mNBinsX, mBinXLo, mBinXHi);
- break;
- case 3:
- hNSigmaKaon = new TH1F(title.Data(),
- Form("nSigmaKaon charge=%2d; n#sigma(K); dN/dn#sigma(e)", mCharge),
- mNBinsX, mBinXLo, mBinXHi);
- break;
- case 4:
- hNSigmaProton = new TH1F(title.Data(),
- Form("nSigmaProton charge=%2d; n#sigma(p); dN/dn#sigma(e)", mCharge),
- mNBinsX, mBinXLo, mBinXHi);
- break;
- default:
- hNSigmaElectron = new TH1F(title.Data(),
- Form("nSigmaElectron charge=%2d; n#sigma(e); dN/dn#sigma(e)", mCharge),
- mNBinsX, mBinXLo, mBinXHi);
- hNSigmaPion = new TH1F(title.Data(),
- Form("nSigmaPion charge=%2d; n#sigma(#pi); dN/dn#sigma(e)", mCharge),
- mNBinsX, mBinXLo, mBinXHi);
- hNSigmaKaon = new TH1F(title.Data(),
- Form("nSigmaKaon charge=%2d; n#sigma(K); dN/dn#sigma(e)", mCharge),
- mNBinsX, mBinXLo, mBinXHi);
- hNSigmaProton = new TH1F(title.Data(),
- Form("nSigmaProton charge=%2d; n#sigma(p); dN/dn#sigma(e)", mCharge),
- mNBinsX, mBinXLo, mBinXHi);
- };
- }
- //_________________
- trackCutMonitor_TpcNSigma::~trackCutMonitor_TpcNSigma() {
- if(hNSigmaElectron) delete hNSigmaElectron;
- if(hNSigmaPion) delete hNSigmaPion;
- if(hNSigmaKaon) delete hNSigmaKaon;
- if(hNSigmaProton) delete hNSigmaProton;
- }
- //_________________
- void trackCutMonitor_TpcNSigma::Fill(const StHbtTrack *track) {
-
- if(track->Charge() == mCharge || mCharge==0) {
- switch(mPartType) {
- case 0:
- hNSigmaElectron->Fill(track->NSigmaElectron());
- hNSigmaPion->Fill(track->NSigmaPion());
- hNSigmaKaon->Fill(track->NSigmaKaon());
- hNSigmaProton->Fill(track->NSigmaProton());
- break;
- case 1:
- hNSigmaElectron->Fill(track->NSigmaElectron());
- break;
- case 2:
- hNSigmaPion->Fill(track->NSigmaPion());
- break;
- case 3:
- hNSigmaKaon->Fill(track->NSigmaKaon());
- break;
- case 4:
- hNSigmaProton->Fill(track->NSigmaProton());
- break;
- default:
- hNSigmaElectron->Fill(track->NSigmaElectron());
- hNSigmaPion->Fill(track->NSigmaPion());
- hNSigmaKaon->Fill(track->NSigmaKaon());
- hNSigmaProton->Fill(track->NSigmaProton());
- }; //switch(mPartType)
- } //if(track->Charge() == mCharge || mCharge==0)
- }
|