46 , fArrPools(
"TClonesArray")
52 for (Int_t i = 0; i <
fMaxCuts; ++i) {
55 fAxes.SetOwner(kTRUE);
100 Error(
"Fill",
"Bin outside range: %s", dim.Data());
105 TClonesArray* poolp =
static_cast<TClonesArray*
>(
fArrPools.At(bin));
108 TClonesArray& pool = *poolp;
115 Info(
"Fill",
"New pool at %d (%s)", bin, dim.Data());
116 poolp =
new (
fArrPools[bin]) TClonesArray(
"PairAnalysisMixedEvent",
fDepth);
117 poolp->SetUniqueID(0);
121 index1 = (poolp->GetUniqueID() + 1) %
fDepth;
124 TClonesArray& pool = *poolp;
132 event->SetProcessID(
fPID);
143 pool.SetUniqueID(index1);
154 if (pool.GetEntriesFast() < 1)
return;
157 TObjArray arrTrDummy[4];
158 for (Int_t i = 0; i < 4; ++i)
159 arrTrDummy[i] = papa->
fTracks[i];
167 TIter ev1P(&arrTrDummy[0]);
168 TIter ev1N(&arrTrDummy[1]);
171 for (Int_t i1 = 0; i1 < pool.GetEntriesFast(); ++i1) {
219 for (Int_t i = 0; i < 4; ++i) {
221 papa->
fTracks[i] = arrTrDummy[i];
236 Info(
"Init",
"Creating a pool array with size %d",
size);
240 for (Int_t i = 0; i <
fAxes.GetEntriesFast(); ++i) {
241 TVectorD* bins =
static_cast<TVectorD*
>(
fAxes.At(i));
242 Int_t nRows = bins->GetNrows();
244 for (Int_t irow = 0; irow < nRows; ++irow) {
245 values += Form(
"%.2f, ", (*bins)[irow]);
249 if (!
fPID) {
fPID = TProcessID::AddProcessID(); }
251 Info(
"Init",
"%s", values.Data());
261 for (Int_t i = 0; i <
fAxes.GetEntriesFast(); ++i)
262 size *= ((
static_cast<TVectorD*
>(
fAxes.At(i)))->GetNrows() - 1);
275 if (
fAxes.GetEntriesFast() == 0) {
276 if (dim) (*dim) =
"single bin";
279 if (dim) (*dim) =
"";
282 for (Int_t i = 0; i <
fAxes.GetEntriesFast(); ++i) {
284 TVectorD* bins =
static_cast<TVectorD*
>(
fAxes.At(i));
285 Int_t nRows = bins->GetNrows();
286 if ((val < (*bins)[0]) || (val > (*bins)[nRows - 1])) {
return -1; }
288 Int_t
pos = TMath::BinarySearch(nRows, bins->GetMatrixArray(), val);
289 bin += sizeAdd *
pos;
291 sizeAdd *= (nRows - 1);
static constexpr size_t size()
ClassImp(PairAnalysisMixingHandler) PairAnalysisMixingHandler
const TClonesArray * GetTrackArrayN() const
const TClonesArray * GetTrackArrayP() const
void SetTracks(const TObjArray &arrP, const TObjArray &arrN)
void AddVariable(PairAnalysisVarManager::ValueTypes type, TVectorD *const bins)
static const Int_t fMaxCuts
UShort_t fEventCuts[fMaxCuts]
void Init(const PairAnalysis *papa=0x0)
Int_t GetNumberOfBins() const
PairAnalysisMixingHandler()
void DoMixing(TClonesArray &pool, PairAnalysis *papa)
internal PID for references to buffered objects
virtual ~PairAnalysisMixingHandler()
Int_t FindBin(const Double_t values[], TString *dim=0x0)
void Fill(const PairAnalysisEvent *ev, PairAnalysis *papa)
static void SetEventData(const Double_t data[PairAnalysisVarManager::kNMaxValuesMC])
static const char * GetValueName(Int_t i)
static void SetValue(ValueTypes var, Double_t val)
static Double_t * GetData()
Bool_t DoEventProcess() const
const TObjArray * GetTrackArray(Int_t i) const
void FillPairArrays(Int_t arr1, Int_t arr2)