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

Add new branches in DIAMANT root tree

Define null events when nbsuframes larger that possible


git-svn-id: svn+ssh://anonsvn.in2p3.fr/agata/gammaware/trunk@2250 c3abf467-7ff2-0310-b516-c5fb849bdde0
parent 6d38d331
......@@ -146,8 +146,13 @@ EventDIAMANTTree::~EventDIAMANTTree()
void EventDIAMANTTree::SetBranches()
{
GetTree()->Branch("nbDIAMANT", &nbDIAMANT, "nbDIAMANT/I");
GetTree()->Branch("DIAMANTBoard", DIAMANTBoard, "DIAMANTBoard[nbDIAMANT]/s" );
GetTree()->Branch("DIAMANTChannel", DIAMANTChannel, "DIAMANTChannel[nbDIAMANT]/s" );
GetTree()->Branch("DIAMANTBoard", BoardId, "DIAMANTBoard[nbDIAMANT]/s" );
GetTree()->Branch("DIAMANTChannel", ChannelId, "DIAMANTChannel[nbDIAMANT]/s" );
GetTree()->Branch("DIAMANT_Stat1" ,Status1, "DIAMANT_Stat1[nbDIAMANT]/I" );
GetTree()->Branch("DIAMANT_Stat2" ,Status2, "DIAMANT_Stat2[nbDIAMANT]/I" );
GetTree()->Branch("DIAMANT_E" ,Energy, "DIAMANT_E[nbDIAMANT]/I" );
GetTree()->Branch("DIAMANT_Top" ,Top, "DIAMANT_Top[nbDIAMANT]/I" );
GetTree()->Branch("TSDIAMANT", &fTimestamp, "TSDIAMANT/l" );
}
......@@ -158,6 +163,14 @@ void EventDIAMANTTree::Exec(Option_t * /*option*/)
SetLastExecStatus(1u);
return;
}
memset(BoardId ,0,sizeof(UShort_t)*MaxDIAMANT);
memset(ChannelId,0,sizeof(UShort_t)*MaxDIAMANT);
memset(Status1,0,sizeof(Int_t)*MaxDIAMANT);
memset(Status2,0,sizeof(Int_t)*MaxDIAMANT);
memset(Energy ,0,sizeof(Int_t)*MaxDIAMANT);
memset(Top ,0,sizeof(Int_t)*MaxDIAMANT);
fTimestamp = ((AgataKey *)fFrame->GetFrame()->GetKey())->GetTimeStamp();
......@@ -171,24 +184,27 @@ void EventDIAMANTTree::Exec(Option_t * /*option*/)
cout<<"Event ignored"<<endl;
fBashColor->ResetColor();
return;
nbDIAMANT=0;
}
for(UInt_t i = 0u; i <number_of_frame; i++) {
for(UInt_t i = 0u; i <nbDIAMANT; i++) {
MFMDiamantFrame *mfmframe = GetMFM(i);
if ( mfmframe == 0x0 ){
std::cout << "BUG" << std::endl;
continue;
}
DIAMANTBoard[i] = mfmframe->GetBoardId();
DIAMANTChannel[i] = mfmframe->GetTGCristalId() ;
BoardId[i] = mfmframe->GetBoardId();
ChannelId[i] = mfmframe->GetTGCristalId() ;
Status1[i] = GetStatus(0);
Status2[i] = GetStatus(1);
Energy[i] = GetEnergy();
Top[i] = GetTop();
}
FillTree();
}
ClassImp(EventDIAMANTWatchers)
ClassImp(EventDIAMANTSpectra)
ClassImp(EventDIAMANTTree)
......
......@@ -114,7 +114,8 @@ class EventDIAMANTTree : public EventDIAMANTWatchers, public TTreeBuilder
private:
Int_t nbDIAMANT; // Number of hits in the array
UShort_t DIAMANTBoard[MaxDIAMANT], DIAMANTChannel[MaxDIAMANT];
UShort_t BoardId[MaxDIAMANT], ChannelId[MaxDIAMANT];
UInt_t Status1[MaxDIAMANT], Status2[MaxDIAMANT], Energy[MaxDIAMANT], Top[MaxDIAMANT];
ULong64_t fTimestamp;
protected:
......
......@@ -163,6 +163,14 @@ void EventNEDATree::Exec(Option_t * /*option*/)
return;
}
memset(BoardId,0,sizeof(UShort_t)*MaxNEDA);
memset(ChannelId,0,sizeof(UShort_t)*MaxNEDA);
memset(NEDATdc,0,sizeof(UShort_t)*MaxNEDA);
memset(NEDAFast,0,sizeof(UShort_t)*MaxNEDA);
memset(NEDASlow,0,sizeof(UShort_t)*MaxNEDA);
memset(NEDAZco,0,sizeof(UShort_t)*MaxNEDA);
fTimestamp = ((AgataKey *)fFrame->GetFrame()->GetKey())->GetTimeStamp();
UInt_t number_of_frame = GetNbSubFrame(); nbNEDA = number_of_frame;
......@@ -175,10 +183,10 @@ void EventNEDATree::Exec(Option_t * /*option*/)
cout<<"Event ignored"<<endl;
fBashColor->ResetColor();
return;
nbNEDA = 0;
}
for(UInt_t i = 0u; i <number_of_frame; i++)
for(UInt_t i = 0u; i <nbNEDA; i++)
{
MFMNedaFrame *mfmframe = GetMFM(i);
if ( mfmframe == 0x0 ){
......
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