newly added

This commit is contained in:
nemu
2010-06-04 11:31:30 +00:00
parent 787a95dad3
commit c4e7d3c57b
14 changed files with 556 additions and 55 deletions

View File

@@ -32,6 +32,7 @@
void t0NotEqFirstGoodData()
{
// load library
gSystem->Load("$ROOTSYS/lib/libTLemRunHeader");
gSystem->Load("$ROOTSYS/lib/libPAddPoissonNoise");
// generate data
@@ -44,7 +45,7 @@ void t0NotEqFirstGoodData()
decayAnaModule = histosFolder->AddFolder("DecayAnaModule", "muSR decay histograms");
// feed run info header
UInt_t runNo = 20001;
UInt_t runNo = 30002;
TString tstr;
runInfo = gROOT->GetRootFolder()->AddFolder("RunInfo", "LEM RunInfo");
gROOT->GetListOfBrowsables()->Add(runInfo, "RunInfo");
@@ -67,23 +68,23 @@ void t0NotEqFirstGoodData()
header->SetNHist(8);
header->SetCuts("none");
header->SetModerator("none");
Double_t tt0[8] = {3419.0, 3519.0, 3419.0, 3519.0, 3419.0, 3519.0, 3419.0, 3519.0};
Double_t tt0[8] = {3419.0, 3420.0, 3520.0, 3521.0, 3417.0, 3418.0, 3522.0, 3523.0};
header->SetTimeZero(tt0);
runInfo->Add(header); //add header to RunInfo folder
// create histos
UInt_t t0[8] = {3419, 3519, 3419, 3519, 3419.0, 3519.0, 3419.0, 3519.0};
UInt_t t0[8] = {3419, 3420, 3520, 3521, 3417, 3418, 3522, 3523};
UInt_t n0[8] = {10000.0, 10000.0, 10000.0, 10000.0, 10000.0, 10000.0, 10000.0, 10000.0};
UInt_t bkg[8] = {11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0};
UInt_t bkg[8] = {10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0};
const Double_t tau = 2197.019; // ns
// asymmetry related stuff
const Double_t timeResolution = 0.1953125; // ns
Double_t a0[8] = {0.26, 0.26, 0.26, 0.26, 0.26, 0.26, 0.26, 0.26};
Double_t a1[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
Double_t phase[8] = {0.0*TMath::Pi()/180.0, 45.0*TMath::Pi()/180.0, 90.0*TMath::Pi()/180.0, 135.0*TMath::Pi()/180.0,
180.0*TMath::Pi()/180.0, 225.0*TMath::Pi()/180.0, 270.0*TMath::Pi()/180.0, 315.0*TMath::Pi()/180.0,};
Double_t phase[8] = {5.0*TMath::Pi()/180.0, 50.0*TMath::Pi()/180.0, 95.0*TMath::Pi()/180.0, 140.0*TMath::Pi()/180.0,
185.0*TMath::Pi()/180.0, 230.0*TMath::Pi()/180.0, 275.0*TMath::Pi()/180.0, 320.0*TMath::Pi()/180.0,};
const Double_t gamma = 0.00001355; // gamma/(2pi)
Double_t bb0 = 200.0; // field in Gauss
Double_t bb0 = 15000.0; // field in Gauss
Double_t bb1 = 400.0; // field in Gauss
Double_t sigma0 = 0.05/1000.0; // Gaussian sigma in 1/ns
Double_t sigma1 = 0.005/1000.0; // Gaussian sigma in 1/ns
@@ -99,32 +100,30 @@ void t0NotEqFirstGoodData()
Double_t time;
Double_t dval;
for (UInt_t i=0; i<8; i++) {
for (UInt_t j=1; j<66601; j++) {
for (UInt_t j=0; j<66600; j++) {
if (j<t0[i]) {
histo[i]->SetBinContent(j, bkg[i]);
histo[i]->SetBinContent(j+1, bkg[i]);
} else {
time = (Double_t)(j-t0[i])*timeResolution;
dval = (Double_t)n0[i]*TMath::Exp(-time/tau)*(1.0+a0[i]*TMath::Exp(-0.5*TMath::Power(time*sigma0,1.2))*TMath::Cos(TMath::TwoPi()*gamma*bb0*time+phase[i])
+a1[i]*TMath::Exp(-0.5*TMath::Power(time*sigma1,2.0))*TMath::Cos(TMath::TwoPi()*gamma*bb1*time+phase[i]))+(Double_t)bkg[i];
histo[i]->SetBinContent(j, (UInt_t)dval);
histo[i]->SetBinContent(j+1, (UInt_t)dval);
}
}
}
// add a promp peak
/*
Double_t ampl = 500.0;
Double_t ampl = 10000.0;
Double_t promptLambda = 500.0/1000.0; // Lorentzain in 1/ns
for (UInt_t i=0; i<4; i++) {
for (UInt_t i=0; i<8; i++) {
for (UInt_t j=1; j<66601; j++) {
dval = histo[i]->GetBinContent(j);
time = (Double_t)(j-t0[i])*timeResolution;
dval += ampl*TMath::Exp(-fabs(time)*promptLambda);
histo[i]->SetBinContent(j, (UInt_t)dval);
histo[i+4]->SetBinContent(j, (UInt_t)dval);
histo[i+8]->SetBinContent(j, (UInt_t)dval);
}
}
*/
// add Poisson noise
PAddPoissonNoise *addNoise = new PAddPoissonNoise();