- // PH case
- if (i == 1) {
-
- for (Int_t k = 0; k < (Int_t) fPlaPH->GetEntriesFast(); k++) {
-
- // Look if fPlaPH[k] it is also in the second vector
- Int_t place = -1;
- for (Int_t j = 0; j < (Int_t) pPlaP2->GetEntriesFast(); j++) {
- if (((AliTRDPlace *) pPlaP2->At(j))->GetPlace() == ((AliTRDPlace *) fPlaPH->At(k))->GetPlace()) {
- place = j;
- break;
- }
- }
-
- // If not in the second vector nothing to do
-
- // If in the second vector
- if (place != -1) {
-
- AliTRDPInfo *fPInfo = new AliTRDPInfo();
- UShort_t *entries = new UShort_t[fTimeMax];
- Float_t *sum = new Float_t[fTimeMax];
- Float_t *sumsquare = new Float_t[fTimeMax];
-
- for (Int_t nu = 0; nu < fTimeMax; nu++) {
-
- entries[nu] = ((AliTRDPInfo *) fVectorPH->At(((AliTRDPlace *) fPlaPH->At(k))->GetPlace()))->GetEntries()[nu]
- + ((AliTRDPInfo *) vVectorP2->At(((AliTRDPlace *) fPlaPH->At(k))->GetPlace()))->GetEntries()[nu];
-
- Double_t calcul = ((((Double_t) ((AliTRDPInfo *) fVectorPH->At(((AliTRDPlace *) fPlaPH->At(k))->GetPlace()))->GetSum()[nu])
- * ((Double_t) ((AliTRDPInfo *) fVectorPH->At(((AliTRDPlace *) fPlaPH->At(k))->GetPlace()))->GetEntries()[nu]))
- + (((Double_t) ((AliTRDPInfo *) vVectorP2->At(((AliTRDPlace *) fPlaPH->At(k))->GetPlace()))->GetSum()[nu])
- * ((Double_t) ((AliTRDPInfo *) vVectorP2->At(((AliTRDPlace *) fPlaPH->At(k))->GetPlace()))->GetEntries()[nu])))
- / ((Double_t) fPInfo->GetEntries()[nu]);
-
- sum[nu] = (Float_t) calcul;
-
- Double_t calculsquare = ((((Double_t) ((AliTRDPInfo *) fVectorPH->At(((AliTRDPlace *) fPlaPH->At(k))->GetPlace()))->GetSumSquare()[nu])
- * ((Double_t) ((AliTRDPInfo *) fVectorPH->At(((AliTRDPlace *) fPlaPH->At(k))->GetPlace()))->GetEntries()[nu]))
- + (((Double_t) ((AliTRDPInfo *) vVectorP2->At(((AliTRDPlace *) fPlaPH->At(k))->GetPlace()))->GetSumSquare()[nu])
- * ((Double_t) ((AliTRDPInfo *) vVectorP2->At(((AliTRDPlace *) fPlaPH->At(k))->GetPlace()))->GetEntries()[nu])))
- / ((Double_t) fPInfo->GetEntries()[nu]);
-
- sumsquare[nu] = calculsquare;
-
- }
-
- // Set
- fPInfo->SetSum(sum);
- fPInfo->SetSumSquare(sumsquare);
- fPInfo->SetEntries(entries);
-
- // Nothing to do on PlaCT1
-
- // Update the vector VectorCT1
- fVectorPH->AddAt((TObject *) fPInfo,((AliTRDPlace *) fPlaPH->At(k))->GetPlace());
-
- }
-
- }
-
- // And at the end the vector in P2 but not in CH1
- for (Int_t k = 0; k < (Int_t) pPlaP2->GetEntriesFast(); k++) {
-
- // Look if PlaCT2[k] it is also in the second vector
- Int_t place = -1;
- for (Int_t j = 0; j < (Int_t) fPlaPH->GetEntriesFast(); j++) {
- if (((AliTRDPlace *) fPlaPH->At(j))->GetPlace() == ((AliTRDPlace *) pPlaP2->At(k))->GetPlace()) {
- place = j;
- break;
- }
- }
-
- // If not in the first vector
- if (place == -1) {
-
- AliTRDPInfo *fPInfo = new AliTRDPInfo();
- fPInfo = (AliTRDPInfo *) vVectorP2->At(((AliTRDPlace *) pPlaP2->At(k))->GetPlace());
-
- // Add at the end of CH1
- fPlaPH->Add(((TObject *) pPlaP2->At(k)));
- fVectorPH->Add((TObject *) fPInfo);
-
- }
-
- }
-
- }
-
- // PRF case
- if (i == 1) {
-
- for (Int_t k = 0; k < (Int_t) fPlaPRF->GetEntriesFast(); k++) {
-
- // Look if fPlaPRF[k] it is also in the second vector
- Int_t place = -1;
- for (Int_t j = 0; j < (Int_t) pPlaP2->GetEntriesFast(); j++) {
- if (((AliTRDPlace *) pPlaP2->At(j))->GetPlace() == ((AliTRDPlace *) fPlaPRF->At(k))->GetPlace()) {
- place = j;
- break;
- }
- }
-
- // If not in the second vector nothing to do
-
- // If in the second vector
- if (place != -1) {
-
- AliTRDPInfo *fPInfo = new AliTRDPInfo();
- UShort_t *entries = new UShort_t[fNumberBinPRF];
- Float_t *sum = new Float_t[fNumberBinPRF];
- Float_t *sumsquare = new Float_t[fNumberBinPRF];
-
- for (Int_t nu = 0; nu < fNumberBinPRF; nu++) {
-
- entries[nu] = ((AliTRDPInfo *) fVectorPRF->At(((AliTRDPlace *) fPlaPRF->At(k))->GetPlace()))->GetEntries()[nu]
- + ((AliTRDPInfo *) vVectorP2->At(((AliTRDPlace *) fPlaPRF->At(k))->GetPlace()))->GetEntries()[nu];
-
- Double_t calcul = ((((Double_t) ((AliTRDPInfo *) fVectorPRF->At(((AliTRDPlace *) fPlaPRF->At(k))->GetPlace()))->GetSum()[nu])
- * ((Double_t) ((AliTRDPInfo *) fVectorPRF->At(((AliTRDPlace *) fPlaPRF->At(k))->GetPlace()))->GetEntries()[nu]))
- + (((Double_t) ((AliTRDPInfo *) vVectorP2->At(((AliTRDPlace *) fPlaPRF->At(k))->GetPlace()))->GetSum()[nu])
- * ((Double_t) ((AliTRDPInfo *) vVectorP2->At(((AliTRDPlace *) fPlaPRF->At(k))->GetPlace()))->GetEntries()[nu])))
- / ((Double_t) fPInfo->GetEntries()[nu]);
-
- sum[nu] = (Float_t) calcul;
-
- Double_t calculsquare = ((((Double_t) ((AliTRDPInfo *) fVectorPRF->At(((AliTRDPlace *) fPlaPRF->At(k))->GetPlace()))->GetSumSquare()[nu])
- * ((Double_t) ((AliTRDPInfo *) fVectorPRF->At(((AliTRDPlace *) fPlaPRF->At(k))->GetPlace()))->GetEntries()[nu]))
- + (((Double_t) ((AliTRDPInfo *) vVectorP2->At(((AliTRDPlace *) fPlaPRF->At(k))->GetPlace()))->GetSumSquare()[nu])
- * ((Double_t) ((AliTRDPInfo *) vVectorP2->At(((AliTRDPlace *) fPlaPRF->At(k))->GetPlace()))->GetEntries()[nu])))
- / ((Double_t) fPInfo->GetEntries()[nu]);
-
- sumsquare[nu] = calculsquare;
-
- }
-
- // Set
- fPInfo->SetSum(sum);
- fPInfo->SetSumSquare(sumsquare);
- fPInfo->SetEntries(entries);
-
- // Nothing to do on PlaCT1
-
- // Update the vector VectorCT1
- fVectorPRF->AddAt((TObject *) fPInfo,((AliTRDPlace *) fPlaPRF->At(k))->GetPlace());
-
- }
-
- }
-
- // And at the end the vector in P2 but not in CH1
- for (Int_t k = 0; k < (Int_t) pPlaP2->GetEntriesFast(); k++) {
-
- // Look if PlaCT2[k] it is also in the second vector
- Int_t place = -1;
- for (Int_t j = 0; j < (Int_t) fPlaPRF->GetEntriesFast(); j++) {
- if (((AliTRDPlace *) fPlaPRF->At(j))->GetPlace() == ((AliTRDPlace *) pPlaP2->At(k))->GetPlace()) {
- place = j;
- break;
- }
- }
-
- // If not in the first vector
- if (place == -1) {
-
- AliTRDPInfo *fPInfo = new AliTRDPInfo();
- fPInfo = (AliTRDPInfo *) vVectorP2->At(((AliTRDPlace *) pPlaP2->At(k))->GetPlace());
-
- // Add at the end of CH1
- fPlaPRF->Add(((TObject *) pPlaP2->At(k)));
- fVectorPRF->Add((TObject *) fPInfo);
-
- }
-
- }
-
- }
-
- return kTRUE;