X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONClusterInput.cxx;h=9b29c342a03972282fe97f2ccbf71378b93ee6f6;hb=067866a396f993ff635c92f3ba766d4a56246152;hp=d89ea6b163ef89e1885605c25f2464d72bf41c2d;hpb=a713db22a500de8b3ba697a788794540da4df231;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONClusterInput.cxx b/MUON/AliMUONClusterInput.cxx index d89ea6b163e..9b29c342a03 100644 --- a/MUON/AliMUONClusterInput.cxx +++ b/MUON/AliMUONClusterInput.cxx @@ -37,13 +37,14 @@ AliMUONMathieson* AliMUONClusterInput::fgMathieson = 0; AliMUONClusterInput::AliMUONClusterInput() : TObject(), fCluster(0), - fChargeCorrel(1.) // in case not defined - + fChargeCorrel(1.), + fDetElemId(0) + { fDigits[0]=0; fDigits[1]=0; - fSegmentation[0]=0; - fSegmentation[1]=0; + fSegmentation2[0]=0; + fSegmentation2[1]=0; } AliMUONClusterInput* AliMUONClusterInput::Instance() @@ -71,60 +72,6 @@ AliMUONClusterInput::AliMUONClusterInput(const AliMUONClusterInput& clusterInput AliFatal("Not implemented."); } -void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig1, TClonesArray* dig2) -{ -// Set pointer to digits with corresponding segmentations and responses (two cathode planes) - fChamber=chamber; - fDigits[0]=dig1; - fDigits[1]=dig2; - fNDigits[0]=dig1->GetEntriesFast(); - fNDigits[1]=dig2->GetEntriesFast(); - - AliMUON *pMUON; - AliMUONChamber* iChamber; - - pMUON = (AliMUON*) gAlice->GetModule("MUON"); - if ((fSegmentationType = pMUON->WhichSegmentation()) != 1) - AliFatal("Wrong segmentation type"); - - iChamber = &(pMUON->Chamber(chamber)); - fgMathieson = new AliMUONMathieson(); - - fSegmentation[0]=iChamber->SegmentationModel(1); - fSegmentation[1]=iChamber->SegmentationModel(2); - - fNseg = 2; - if (chamber < AliMUONConstants::NTrackingCh()) { - if (chamber > 1 ) { - fgMathieson->SetPitch(AliMUONConstants::Pitch()); - fgMathieson->SetSqrtKx3AndDeriveKx2Kx4(AliMUONConstants::SqrtKx3()); - fgMathieson->SetSqrtKy3AndDeriveKy2Ky4(AliMUONConstants::SqrtKy3()); - fChargeCorrel = AliMUONConstants::ChargeCorrel(); - } else { - fgMathieson->SetPitch(AliMUONConstants::PitchSt1()); - fgMathieson->SetSqrtKx3AndDeriveKx2Kx4(AliMUONConstants::SqrtKx3St1()); - fgMathieson->SetSqrtKy3AndDeriveKy2Ky4(AliMUONConstants::SqrtKy3St1()); - fChargeCorrel = AliMUONConstants::ChargeCorrelSt1(); - } - } -} - -void AliMUONClusterInput::SetDigits(Int_t chamber, TClonesArray* dig) -{ -// Set pointer to digits with corresponding segmentations and responses (one cathode plane) - fDigits[0]=dig; - AliMUON *pMUON; - AliMUONChamber* iChamber; - - pMUON = (AliMUON*) gAlice->GetModule("MUON"); - if ((fSegmentationType = pMUON->WhichSegmentation()) != 1) - AliFatal("Wrong segmentation type"); - - iChamber = &(pMUON->Chamber(chamber)); - fSegmentation[0]=iChamber->SegmentationModel(1); - - fNseg=1; -} void AliMUONClusterInput::SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig1, TClonesArray* dig2) { // Set pointer to digits with corresponding segmentations and responses (two cathode planes) @@ -142,8 +89,6 @@ void AliMUONClusterInput::SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig iChamber = &(pMUON->Chamber(chamber)); fgMathieson = new AliMUONMathieson(); - if ((fSegmentationType = pMUON->WhichSegmentation()) != 2) - AliFatal("Wrong segmentation type"); fSegmentation2[0]=iChamber->SegmentationModel2(1); fSegmentation2[1]=iChamber->SegmentationModel2(2); @@ -177,9 +122,7 @@ void AliMUONClusterInput::SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig pMUON = (AliMUON*) gAlice->GetModule("MUON"); iChamber = &(pMUON->Chamber(chamber)); - if ((fSegmentationType = pMUON->WhichSegmentation()) != 2) - AliFatal("Wrong segmentation type"); - + fSegmentation2[0]=iChamber->SegmentationModel2(1); fNseg=1; @@ -188,20 +131,20 @@ void AliMUONClusterInput::SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig void AliMUONClusterInput::SetCluster(AliMUONRawCluster* cluster) { // Set the current cluster - //PH printf("\n %p \n", cluster); - fCluster=cluster; - Float_t qtot; - Int_t i, cath, ix, iy; - AliMUONDigit* digit; - fNmul[0]=cluster->GetMultiplicity(0); - fNmul[1]=cluster->GetMultiplicity(1); - //PH printf("\n %p %p ", fDigits[0], fDigits[1]); - - for (cath=0; cath<2; cath++) { - qtot=0; - for (i=0; iGetMultiplicity(0); + fNmul[1]=cluster->GetMultiplicity(1); + //PH printf("\n %p %p ", fDigits[0], fDigits[1]); + + for (cath=0; cath<2; cath++) { + qtot=0; + for (i=0; iUncheckedAt(cluster->GetIndex(i,cath))); // pad coordinates ix = digit->PadX(); @@ -217,11 +160,7 @@ void AliMUONClusterInput::SetCluster(AliMUONRawCluster* cluster) qtot+=fCharge[i][cath]; // Current z Float_t xc, yc; - if (fSegmentationType == 1) - fSegmentation[cath]->GetPadC(ix,iy,xc,yc,fZ); - else - fSegmentation2[cath]->GetPadC(fDetElemId,ix,iy,xc,yc,fZ); - + fSegmentation2[cath]->GetPadC(fDetElemId,ix,iy,xc,yc,fZ); } // loop over cluster digits fQtot[cath]=qtot; fChargeTot[cath]=Int_t(qtot); @@ -242,21 +181,11 @@ Float_t AliMUONClusterInput::DiscrChargeCombiS1(Int_t i,Double_t *par, Int_t cat // par[1] y-position of cluster Float_t q1; - if (fSegmentationType == 1) { - - fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]); - // First Cluster - fSegmentation[cath]->SetHit(par[0],par[1],fZ); - q1 = fgMathieson->IntXY(fSegmentation[cath]); - - } else { - - fSegmentation2[cath]->SetPad(fDetElemId, fix[i][cath], fiy[i][cath]); - // First Cluster - fSegmentation2[cath]->SetHit(fDetElemId, par[0],par[1],fZ); - q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]); - } - + fSegmentation2[cath]->SetPad(fDetElemId, fix[i][cath], fiy[i][cath]); + // First Cluster + fSegmentation2[cath]->SetHit(fDetElemId, par[0],par[1],fZ); + q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]); + Float_t value = fQtot[cath]*q1; return value; } @@ -273,29 +202,15 @@ Float_t AliMUONClusterInput::DiscrChargeS2(Int_t i,Double_t *par) Float_t q1, q2; - if (fSegmentationType == 1) { - - fSegmentation[0]->SetPad(fix[i][0], fiy[i][0]); - // First Cluster - fSegmentation[0]->SetHit(par[0],par[1],fZ); - q1 = fgMathieson->IntXY(fSegmentation[0]); - - // Second Cluster - fSegmentation[0]->SetHit(par[2],par[3],fZ); - q2 = fgMathieson->IntXY(fSegmentation[0]); - - } else { - - fSegmentation2[0]->SetPad(fDetElemId, fix[i][0], fiy[i][0]); - // First Cluster - fSegmentation2[0]->SetHit(fDetElemId, par[0],par[1],fZ); - q1 = fgMathieson->IntXY(fSegmentation[0]); - - // Second Cluster - fSegmentation2[0]->SetHit(fDetElemId,par[2],par[3],fZ); - q2 = fgMathieson->IntXY(fDetElemId, fSegmentation2[0]); - } - + fSegmentation2[0]->SetPad(fDetElemId, fix[i][0], fiy[i][0]); + // First Cluster + fSegmentation2[0]->SetHit(fDetElemId, par[0],par[1],fZ); + q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[0]); + + // Second Cluster + fSegmentation2[0]->SetHit(fDetElemId,par[2],par[3],fZ); + q2 = fgMathieson->IntXY(fDetElemId, fSegmentation2[0]); + Float_t value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2); return value; } @@ -312,27 +227,15 @@ Float_t AliMUONClusterInput::DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cat Float_t q1, q2; - if (fSegmentationType == 1) { - - fSegmentation[cath]->SetPad(fix[i][cath], fiy[i][cath]); - // First Cluster - fSegmentation[cath]->SetHit(par[0],par[1],fZ); - q1 = fgMathieson->IntXY(fSegmentation[cath]); - - // Second Cluster - fSegmentation[cath]->SetHit(par[2],par[3],fZ); - q2 = fgMathieson->IntXY(fSegmentation[cath]); - - } else { - fSegmentation2[cath]->SetPad(fDetElemId,fix[i][cath], fiy[i][cath]); - // First Cluster - fSegmentation2[cath]->SetHit(fDetElemId,par[0],par[1],fZ); - q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]); - - // Second Cluster - fSegmentation2[cath]->SetHit(fDetElemId,par[2],par[3],fZ); - q2 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]); - } + fSegmentation2[cath]->SetPad(fDetElemId,fix[i][cath], fiy[i][cath]); + // First Cluster + fSegmentation2[cath]->SetHit(fDetElemId,par[0],par[1],fZ); + q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]); + + // Second Cluster + fSegmentation2[cath]->SetHit(fDetElemId,par[2],par[3],fZ); + q2 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]); + Float_t value; if (cath==0) { value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);