Commit c4527b8a authored by J.Dudouet [IPNL/CSNSM]'s avatar J.Dudouet [IPNL/CSNSM]
Browse files

adapt KeyWatchers to anc0 and anc2, remove vamos dependance


git-svn-id: svn+ssh://anonsvn.in2p3.fr/agata/gammaware/trunk@2239 c3abf467-7ff2-0310-b516-c5fb849bdde0
parent 614124d4
......@@ -50,21 +50,18 @@ KeyWatcher::KeyWatcher( const char * name, const char * title, TDirectory *sp_di
fHistInMinMetaSync = MakeTH1<TH1F>((TString)name+"_12hour_MetaSync",(TString)title+" on 12 hour for meta sync frames (1bin=6s)",7200,0,720);
fHistInHMetaSync = MakeTH1<TH1F>((TString)name+"_2days_MetaSync",(TString)title+" on 2 days for meta sync frames (1bin=6min)",480,0,48);
const int NMess = 10;
const int NMess = 14;
fHistMessageType = MakeTH1<TH1I>("MessageType","Message type",NMess,0,NMess);
TString labels[NMess] = {"event:data","event:data:psa","","data:tracked","data:psa","data:ranc0","data:ccrystal","data:crystal","conf:global","meta:sync"};
TString labels[NMess] = {"event:data","event:data:psa","event:data:ranc0","event:data:ranc1","","data:crystal","data:ccrystal","data:psa","data:ranc0","data:ranc1","data:tracked","","conf:global","meta:sync"};
for(int i=0 ; i<NMess ; i++) fHistMessageType->GetXaxis()->SetBinLabel(i+1,labels[i]);
fHistFold = MakeTH1<TH1I>("CrystalFold","CrystalFold",20,0,20);
fHistDTPSA = MakeTH1<TH1I>("TimeStampSpreadPSA","Time stamp spread in the event:data:psa frame",190,0,1900);
fHistDTEvent = MakeTH1<TH1I>("TS_vamos-TS_agata","Time stamp spread in the event:data frame",600,-3000,3000);
fHistDTPerCrystal = MakeTH2<TH2I>("TimeStampSpreadPerCrystal","Time stamp spread in the event:data:psa frame per crystal ID",50,0,50,190,0,1900);
fHistDTEventPerCrystal = MakeTH2<TH2I>("Tvamos-TAgata_per_crystal","Time VAMOS - Time AGATA per crystal",50,0,50,600,-3000,3000);
fHistDTAnc0 = MakeTH1<TH1I>("TS_anc0-TS_agata","Time stamp spread in the event:data frame between agata and anc0",600,-3000,3000);
fHistDTAnc1 = MakeTH1<TH1I>("TS_anc1-TS_agata","Time stamp spread in the event:data frame between agata and anc1",600,-3000,3000);
fBufferToRead = new BufferIO();
......@@ -343,12 +340,16 @@ void KeyWatcher::Exec(Option_t * /*option*/)
fBufferToRead->SetEffectiveSize(MainKey->GetFrameLength()-20u);
double DTEvent = 0.;
double DTEventPC[50];
ULong64_t TimeAGATA=0;
ULong64_t TimeAGATAPC[50];
for(int i=0 ; i<50 ; i++) TimeAGATA = 0;
ULong64_t TimeVamos=0;
bool IsVamos = false;
for(int i=0 ; i<50 ; i++)
TimeAGATA = 0;
ULong64_t TimeAnc0=0;
ULong64_t TimeAnc1=0;
bool IsAnc0 = false;
bool IsAnc1 = false;
bool IsAGATA = false;
if ( MessageType.Contains("event") )
......@@ -435,10 +436,13 @@ void KeyWatcher::Exec(Option_t * /*option*/)
}
if(SubMess=="data:ranc0" && MessageType=="event:data")
{
TimeVamos = timestamp;
IsVamos = true;
// double DTEvent = (timestamp-fTimestamp)*10;
// fHistDTEvent->Fill(DTEvent);
TimeAnc0 = timestamp;
IsAnc0 = true;
}
if(SubMess=="data:ranc1" && MessageType=="event:data")
{
TimeAnc1 = timestamp;
IsAnc1 = true;
}
if(SubMess=="data:psa")
{
......@@ -466,18 +470,15 @@ void KeyWatcher::Exec(Option_t * /*option*/)
fHistFold->Fill(Fold);
}
if(IsVamos&&IsAGATA)
{
DTEvent = (double)(TimeVamos*1.-TimeAGATA*1.)*10;
fHistDTEvent->Fill(DTEvent);
for(int i=0 ; i<50 ; i++)
{
if(TimeAGATAPC[i]!=0)
if(IsAnc0&&IsAGATA)
{
DTEventPC[i] = (TimeVamos*1.-TimeAGATAPC[i]*1.)*10;
fHistDTEventPerCrystal->Fill(i,DTEventPC[i]);
}
DTEvent = (double)(TimeAnc0*1.-TimeAGATA*1.)*10;
fHistDTAnc0->Fill(DTEvent);
}
if(IsAnc1&&IsAGATA)
{
DTEvent = (double)(TimeAnc1*1.-TimeAGATA*1.)*10;
fHistDTAnc1->Fill(DTEvent);
}
}
......@@ -633,21 +634,21 @@ void KeyWatcher::ShowMessageType()
gPad->SetBottomMargin(bottommarg);
gPad->SetLogy();
fHistDTEvent->SetBit(TH1::kNoTitle);
fHistDTEvent->GetYaxis()->SetTitle("Counts");
fHistDTEvent->GetYaxis()->SetTitleSize(0.09);
fHistDTEvent->GetYaxis()->SetLabelSize(0.08);
fHistDTEvent->GetYaxis()->SetTitleOffset(0.4);
fHistDTAnc0->SetBit(TH1::kNoTitle);
fHistDTAnc0->GetYaxis()->SetTitle("Counts");
fHistDTAnc0->GetYaxis()->SetTitleSize(0.09);
fHistDTAnc0->GetYaxis()->SetLabelSize(0.08);
fHistDTAnc0->GetYaxis()->SetTitleOffset(0.4);
fHistDTEvent->GetXaxis()->SetTitle("#DeltaT Event (ns)");
fHistDTEvent->GetXaxis()->SetTitleSize(0.09);
fHistDTEvent->GetXaxis()->SetLabelSize(0.08);
fHistDTAnc0->GetXaxis()->SetTitle("#DeltaT Event (ns)");
fHistDTAnc0->GetXaxis()->SetTitleSize(0.09);
fHistDTAnc0->GetXaxis()->SetLabelSize(0.08);
fHistDTEvent->Draw();
fHistDTAnc0->Draw();
gPad->Modified();
gPad->Update();
st = (TPaveStats*)fHistDTEvent->FindObject("stats");
st = (TPaveStats*)fHistDTAnc0->FindObject("stats");
if(st)
{
st->SetX2NDC(1-rightmarg);
......@@ -684,8 +685,11 @@ void KeyWatcher::ShowMessageType()
{
st->SetX2NDC(1-rightmarg);
st->SetY2NDC(1-topmarg);
st->SetX1NDC(0.743455);
st->SetY1NDC(0.672483);
}
c->cd(4)->cd(2);
gPad->SetRightMargin(rightmarg);
......@@ -694,27 +698,28 @@ void KeyWatcher::ShowMessageType()
gPad->SetBottomMargin(bottommarg);
gPad->SetLogz();
fHistDTEventPerCrystal->SetBit(TH1::kNoTitle);
fHistDTEventPerCrystal->GetYaxis()->SetTitle("#DeltaT VAMOS - AGATA (ns)");
fHistDTEventPerCrystal->GetYaxis()->SetTitleSize(0.09);
fHistDTEventPerCrystal->GetYaxis()->SetLabelSize(0.08);
fHistDTEventPerCrystal->GetYaxis()->SetTitleOffset(0.4);
fHistDTAnc1->SetBit(TH1::kNoTitle);
fHistDTAnc1->GetYaxis()->SetTitle("Counts");
fHistDTAnc1->GetYaxis()->SetTitleSize(0.09);
fHistDTAnc1->GetYaxis()->SetLabelSize(0.08);
fHistDTAnc1->GetYaxis()->SetTitleOffset(0.4);
fHistDTEventPerCrystal->GetXaxis()->SetTitle("Crystal ID");
fHistDTEventPerCrystal->GetXaxis()->SetTitleSize(0.09);
fHistDTEventPerCrystal->GetXaxis()->SetLabelSize(0.08);
fHistDTAnc1->GetXaxis()->SetTitle("#DeltaT Event (ns)");
fHistDTAnc1->GetXaxis()->SetTitleSize(0.09);
fHistDTAnc1->GetXaxis()->SetLabelSize(0.08);
fHistDTEventPerCrystal->Draw("col");
fHistDTAnc1->Draw();
gPad->Modified();
gPad->Update();
st = (TPaveStats*)fHistDTEventPerCrystal->FindObject("stats");
st = (TPaveStats*)fHistDTAnc1->FindObject("stats");
if(st)
{
st->SetX2NDC(1-rightmarg);
st->SetY2NDC(1-topmarg);
st->SetX1NDC(0.743455);
st->SetY1NDC(0.672483);
}
}
void KeyWatcher::DumpKeys(bool ActiveDump)
......
......@@ -51,9 +51,10 @@ protected:
TH1 *fHistMessageType;
TH1 *fHistFold;
TH1 *fHistDTPSA;
TH1 *fHistDTEvent;
TH2 *fHistDTPerCrystal;
TH2 *fHistDTEventPerCrystal;
TH1 *fHistDTAnc0;
TH1 *fHistDTAnc1;
ULong64_t FirstTimeStamp;
ULong64_t FirstEventNumber;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment