34 return Watcher::GetFromTrigger(trigger,
"event:data", fFrame);
41 Bool_t ok =
false; TString f_type; TH1F *h;
44 if ( ! Watcher::SetTrigger(trigger) )
49 if( ! GetTrigger()->GetInputFrame(0u)->IsComposite() )
52 fFrame = GetTrigger()->GetInputSharedFP(0u);
53 f_type = fFrame->GetFrame()->GetSignature().GetItemName();
55 h = MakeTH1<TH1F>(Form(
"DiffCTS_%s",f_type.Data()),
"Time between two consecutive events",1000,0, 10000000);
56 fCoinc->AddAt( h , 0 );
60 for(UInt_t which = 1u; which < GetTrigger()->GetNbInputFrame(); which++){
62 Frame *f = GetTrigger()->GetInputFrame(which);
69 h = MakeTH1<TH1F>(Form(
"TS_%s",f_type.Data()),
"TS Coinc in a composite Frame",500,0,500);
70 fCoinc->AddAt(h,which);
73 if ( dynamic_cast<AgataFrameTrigger *> (GetTrigger())) {
80 TSCoinc::TSCoinc(
const char *name,
const char *title, TDirectory *sp_dir, TDirectory *tag_dir) :
83 fCoinc( new TObjArray() ),
86 fCoincPerCrystal = MakeTH2<TH2F>(
"CoincPerCrystal",
"TS Coinc in a composite Frame",180,0,180,500,0,500);
94 c->Divide(2,2,0.001,0.001);
98 fCoinc->At(0)->Draw();
101 for (Int_t i = 1u; i < fCoinc->GetSize() ; i++ ) {
103 if ( fCoinc->At(i) == 0x0 )
107 fCoinc->At(i)->Draw();
111 fCoinc->At(i)->Draw(
"same");
114 c->cd(3); fCoincPerCrystal->Draw();
127 TH1F *h =
dynamic_cast<TH1F*
>(fCoinc->At(0));
146 if ( h == 0x0 || subkey == 0x0 )
157 UInt_t crysal_id = data->
GetUID();
160 fCoincPerCrystal->Fill( crysal_id, subsubkey->
GetTimeStamp() - fLastTimeStamp );
virtual Bool_t IsValid() const
true if it is a valid pointer
virtual Key * GetKey()=0
To get the Key associated to this frame.
TSCoinc(const char *name, const char *title, TDirectory *sp_dir=0x0, TDirectory *tag_dir=0x0)
virtual Frame * GetFrame() const
virtual Bool_t SetTrigger(ADF::DFTrigger *=0x0)
Set the trigger attached to this watcher.
virtual UInt_t Read()
It reads the content into dedicated structures from the Frame (data part)
const FactoryItem & GetSignature() const
virtual Int_t GetUID() const =0
to get the crystal ID
static ConfAgent * theGlobalAgent(std::string="Agata")
to get the global agent
virtual ULong64_t GetTimeStamp() const =0
To set the timestamp.
virtual UInt_t GetNbInputFrame() const =0
number of input frames that define this trigger
void SetLastExecStatus(Short_t s=0)
reset last status. 0 means no error, 0 < means error, > 0 means ok with conditions ...
SharedFP * fPSAFrame
Utilities i.e. fPSA to decode PSA Frames.
header file for PSAFrame.cpp
virtual Frame * GetInputFrame(UInt_t which=0u)=0
to get back the frames that define this trigger
Base Watcher working for any event:data.
virtual void Exec(Option_t *option="")
watch the current frame
header file for AgataKeyFactory.cpp
SharedFP * fFrame
main frame i.e. event:data
To be used for Agata Data Flow.
Gives the distribution of the different timstamps in a composite frame.
virtual Bool_t LinkSubFrame(UInt_t, Frame *)
Attach the sub-frame corresponding to the given subkey # to the Frame given in the second argument...
virtual void DoCanvas(TCanvas *c, Option_t *)
To be overwritten by real implementation if a canvas is produced.
Base class for a trigger on a data flow.
virtual Bool_t SetTrigger(ADF::DFTrigger *=0x0)
Set the trigger attached to this watcher.
virtual ADF::DFTrigger * GetTrigger() const
To know the trigger in which the frame to be watched is embedded.
virtual UInt_t GetNbSubFrame() const
Returns the number of sub-frames composing this frame. Scan have to be called first.
const std::string & GetItemName() const
const FactoryItem & GetSignature() const
Signature of that frame.