Skip to content

Commit

Permalink
Added tpats for califa online
Browse files Browse the repository at this point in the history
  • Loading branch information
jose-luis-rs committed May 21, 2022
1 parent 8e5264d commit 7c4e9d1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
17 changes: 17 additions & 0 deletions califa/online/R3BCalifaOnlineSpectra.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ R3BCalifaOnlineSpectra::R3BCalifaOnlineSpectra(const TString& name, Int_t iVerbo
, fMap_Par(NULL)
, fNEvents(0)
, fTrigger(-1)
, fTpat1(-1)
, fTpat2(-1)
, fNbCalifaCrystals(4864)
, fNumSides(Nb_Sides)
, fNumRings(Nb_Rings)
Expand Down Expand Up @@ -1309,6 +1311,21 @@ void R3BCalifaOnlineSpectra::Exec(Option_t* option)
{
if ((fTrigger >= 0) && (header) && (header->GetTrigger() != fTrigger))
return;
// fTpat = 1-16; fTpat_bit = 0-15
Int_t fTpat_bit1 = fTpat1 - 1;
Int_t fTpat_bit2 = fTpat2 - 1;
Int_t tpatbin;
if (header && fTpat1 >= 0 && fTpat2 >= 0)
{
for (int i = 0; i < 16; i++)
{
tpatbin = (header->GetTpat() & (1 << i));
if (tpatbin != 0 && (i < fTpat_bit1 || i > fTpat_bit2))
{
return;
}
}
}

int64_t wr[2];
int64_t wrm = 0.0;
Expand Down
14 changes: 12 additions & 2 deletions califa/online/R3BCalifaOnlineSpectra.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
******************************************************************************/

#ifndef R3BCALIFAONLINESPECTRA_H
#define R3BCALIFAONLINESPECTRA_H
#define R3BCALIFAONLINESPECTRA_H 1

#include "FairTask.h"
#include "TCanvas.h"
Expand Down Expand Up @@ -40,7 +40,6 @@ class R3BEventHeader;
*/
class R3BCalifaOnlineSpectra : public FairTask
{

public:
/**
* Default constructor.
Expand Down Expand Up @@ -162,11 +161,22 @@ class R3BCalifaOnlineSpectra : public FairTask
*/
void SetTrigger(Int_t trigger) { fTrigger = trigger; }

/**
* Method for selecting tpat values.
*/
void SetTpat(Int_t tpat1, Int_t tpat2)
{
fTpat1 = tpat1;
fTpat2 = tpat2;
}

private:
void SetParameter();

Int_t fMapHistos_max;
Int_t fMapHistos_bins;
Int_t fTpat1;
Int_t fTpat2;

R3BCalifaMappingPar* fMap_Par; /**< Container with mapping parameters. >*/
TClonesArray* fMappedItemsCalifa; /**< Array with mapped items. */
Expand Down

0 comments on commit 7c4e9d1

Please sign in to comment.