Skip to content

Commit

Permalink
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
amorsch committed Jan 27, 2014
2 parents 233c6a8 + 5d89ca0 commit 8ae1866
Show file tree
Hide file tree
Showing 15 changed files with 368 additions and 44 deletions.
6 changes: 4 additions & 2 deletions ANALYSIS/AliAnalysisAlien.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3698,9 +3698,11 @@ const char *AliAnalysisAlien::GetListOfFiles(const char *type)
return files.Data();
}
if (mgr->GetOutputEventHandler()) {
aodfiles = mgr->GetOutputEventHandler()->GetOutputFileName();
aodfiles = "";
if (mgr->GetOutputEventHandler()->GetFillAOD())
aodfiles = mgr->GetOutputEventHandler()->GetOutputFileName();
TString extraaod = mgr->GetOutputEventHandler()->GetExtraOutputs();
if (!extraaod.IsNull()) {
if (!extraaod.IsNull() && mgr->GetOutputEventHandler()->GetFillExtension()) {
aodfiles += ",";
aodfiles += extraaod;
}
Expand Down
6 changes: 5 additions & 1 deletion ANALYSIS/ESDfilter/AliAnalysisTaskESDfilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ AliAnalysisTaskESDfilter::AliAnalysisTaskESDfilter():
fDoPropagateTrackToEMCal(kTRUE),
fEMCalSurfaceDistance(440),
fRefitVertexTracks(-1),
fRefitVertexTracksNCuts(0),
fRefitVertexTracksCuts(0)
{
// Default constructor
Expand Down Expand Up @@ -203,6 +204,7 @@ AliAnalysisTaskESDfilter::AliAnalysisTaskESDfilter(const char* name):
fDoPropagateTrackToEMCal(kTRUE),
fEMCalSurfaceDistance(440),
fRefitVertexTracks(-1),
fRefitVertexTracksNCuts(0),
fRefitVertexTracksCuts(0)
{
// Constructor
Expand Down Expand Up @@ -2284,7 +2286,8 @@ void AliAnalysisTaskESDfilter::ConvertESDtoAOD()

AliCodeTimerAuto("",0);

if (fRefitVertexTracks) AliESDUtils::RefitESDVertexTracks(esd,fRefitVertexTracks,fRefitVertexTracksCuts);
if (fRefitVertexTracks) AliESDUtils::RefitESDVertexTracks(esd,fRefitVertexTracks,
fRefitVertexTracksNCuts ? fRefitVertexTracksCuts:0);

fOldESDformat = ( esd->GetAliESDOld() != 0x0 );

Expand Down Expand Up @@ -2649,5 +2652,6 @@ void AliAnalysisTaskESDfilter::SetRefitVertexTracks(Int_t algo, Double_t* cuts)
if (algo>0 && cuts) {
fRefitVertexTracksCuts = new Double_t[fRefitVertexTracks];
for (int i=fRefitVertexTracks;i--;) fRefitVertexTracksCuts[i] = cuts[i];
fRefitVertexTracksNCuts = fRefitVertexTracks;
}
}
5 changes: 3 additions & 2 deletions ANALYSIS/ESDfilter/AliAnalysisTaskESDfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@ class AliAnalysisTaskESDfilter : public AliAnalysisTaskSE
Double_t fEMCalSurfaceDistance; // EMCal surface distance from the center of the detector (r = 440 by default)
//
Int_t fRefitVertexTracks; // request to refit the vertex if >=0 (algoID if cuts not supplied, otherwise ncuts)
Double_t* fRefitVertexTracksCuts; // optional cuts for vertex refit
Int_t fRefitVertexTracksNCuts; // number of cut parameters
Double_t* fRefitVertexTracksCuts; //[fRefitVertexTracksNCuts] optional cuts for vertex refit

ClassDef(AliAnalysisTaskESDfilter, 18); // Analysis task for standard ESD filtering
ClassDef(AliAnalysisTaskESDfilter, 19); // Analysis task for standard ESD filtering
};

#endif
1 change: 1 addition & 0 deletions ANALYSIS/TenderSupplies/AliPHOSTenderSupply.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -856,3 +856,4 @@ void AliPHOSTenderSupply::DistanceToBadChannel(Int_t mod, TVector3 * locPos, Dou

}


7 changes: 5 additions & 2 deletions ANALYSIS/macros/AODtrain.C
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ Bool_t doPIDqa = 1; //new
//==============================================================================
TString configPWGHFd2h = (iCollision==0)?"$ALICE_ROOT/PWGHF/vertexingHF/ConfigVertexingHF.C"
:"$ALICE_ROOT/PWGHF/vertexingHF/ConfigVertexingHF_highmult.C";



Double_t *cutsESDfilterReVtx = 0; // optional cuts for revertexing

// Temporaries.
void AODmerge();
void AddAnalysisTasks();
Expand Down Expand Up @@ -234,7 +237,7 @@ void AddAnalysisTasks(const char *cdb_location){
} else {
taskesdfilter = AddTaskESDFilter(useKFILTER, kFALSE, kFALSE, kFALSE /*usePhysicsSelection*/,kFALSE,kTRUE,kFALSE,kFALSE,run_flag); // others
}
if (iESDfilterReVtx>=0 && taskesdfilter) taskesdfilter->SetRefitVertexTracks(iESDfilterReVtx);
if (iESDfilterReVtx>=0 && taskesdfilter) taskesdfilter->SetRefitVertexTracks(iESDfilterReVtx, cutsESDfilterReVtx);
}

// ********** PWG3 wagons ******************************************************
Expand Down
11 changes: 7 additions & 4 deletions ITS/UPGRADE/testITSU/DetectorK.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,9 @@ void DetectorK::AddTPC(Float_t phiResMean, Float_t zResMean, Int_t skip) {
AddLayer((char*)"OFC", 254.0,0.01367); // Outer Field cage

// % Radiation Lengths ... Average per TPC row (i.e. total/159 )
Float_t radLBoubdary = 0.0165;
Float_t rBoundary = 70.0; // cm
const int kNPassiveBound = 2;
const Float_t radLBoubdary[kNPassiveBound] = {0.05, 0.0165};
const Float_t rBoundary[kNPassiveBound] = {50, 70.0}; // cm

Float_t radLPerRow = 0.000036;

Expand All @@ -496,8 +497,10 @@ void DetectorK::AddTPC(Float_t phiResMean, Float_t zResMean, Int_t skip) {
Float_t row64Radius = 135.1 ; // cm
Float_t row128Radius = 199.2 ; // cm

// add boundary between ITS and TPC
AddLayer("tpc_boundary",rBoundary,radLBoubdary); // dummy errors
// add boundaries between ITS and TPC
for (int i=0;i<kNPassiveBound;i++) {
AddLayer(Form("tpc_boundary%d",i),rBoundary[i],radLBoubdary[i]); // dummy errors
}

for ( Int_t k = 0 ; k < tpcRows ; k++ ) {

Expand Down
1 change: 1 addition & 0 deletions STEER/AOD/AliAODHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class AliAODHandler : public AliVEventHandler {
// AliAODExtension* FindExtensionContainingBranch(const char* bname) const;
Bool_t IsStandard() const {return fIsStandard;}
Bool_t GetFillAOD() const {return fFillAOD;}
Bool_t GetFillExtension() const {return fFillExtension;}
Bool_t NeedsHeaderReplication() const {return fNeedsHeaderReplication;}
Bool_t NeedsTOFHeaderReplication() const {return fNeedsTOFHeaderReplication;}
Bool_t NeedsVZEROReplication() const {return fNeedsVZEROReplication;}
Expand Down
176 changes: 158 additions & 18 deletions STEER/AOD/AliAODTrack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,6 @@ Bool_t AliAODTrack::GetXYZAt(Double_t x, Double_t b, Double_t *r) const
//conversion of track parameter representation is
//based on the implementation of AliExternalTrackParam::Set(...)
//maybe some of this code can be moved to AliVTrack to avoid code duplication
const double kSafe = 1e-5;
Double_t alpha=0.0;
Double_t radPos2 = fPosition[0]*fPosition[0]+fPosition[1]*fPosition[1];
Double_t radMax = 45.; // approximately ITS outer radius
Expand All @@ -912,27 +911,10 @@ Bool_t AliAODTrack::GetXYZAt(Double_t x, Double_t b, Double_t *r) const
TMath::DegToRad()*(20*((((Int_t)(phiPos*TMath::RadToDeg()))/20))+10);
}
//
Double_t cs=TMath::Cos(alpha), sn=TMath::Sin(alpha);
// protection: avoid alpha being too close to 0 or +-pi/2
if (TMath::Abs(sn)<kSafe) {
alpha = kSafe;
cs=TMath::Cos(alpha);
sn=TMath::Sin(alpha);
}
else if (cs<kSafe) {
alpha -= TMath::Sign(kSafe, alpha);
cs=TMath::Cos(alpha);
sn=TMath::Sin(alpha);
}

// Get the vertex of origin and the momentum
TVector3 ver(fPosition[0],fPosition[1],fPosition[2]);
TVector3 mom(Px(),Py(),Pz());
//
// avoid momenta along axis
if (TMath::Abs(mom[0])<kSafe) mom[0] = TMath::Sign(kSafe*TMath::Abs(mom[1]), mom[0]);
if (TMath::Abs(mom[1])<kSafe) mom[1] = TMath::Sign(kSafe*TMath::Abs(mom[0]), mom[1]);

// Rotate to the local coordinate system
ver.RotateZ(-alpha);
mom.RotateZ(-alpha);
Expand Down Expand Up @@ -961,6 +943,164 @@ Bool_t AliAODTrack::GetXYZAt(Double_t x, Double_t b, Double_t *r) const
return Local2GlobalPosition(r,alpha);
}

//_____________________________________________________________________________
Bool_t AliAODTrack::GetXYZatR(Double_t xr,Double_t bz, Double_t *xyz, Double_t* alpSect) const
{
// This method has 3 modes of behaviour
// 1) xyz[3] array is provided but alpSect pointer is 0: calculate the position of track intersection
// with circle of radius xr and fill it in xyz array
// 2) alpSect pointer is provided: find alpha of the sector where the track reaches local coordinate xr
// Note that in this case xr is NOT the radius but the local coordinate.
// If the xyz array is provided, it will be filled by track lab coordinates at local X in this sector
// 3) Neither alpSect nor xyz pointers are provided: just check if the track reaches radius xr
//
//
Double_t alpha=0.0;
Double_t radPos2 = fPosition[0]*fPosition[0]+fPosition[1]*fPosition[1];
Double_t radMax = 45.; // approximately ITS outer radius
if (radPos2 < radMax*radMax) { // inside the ITS
alpha = fMomentum[1]; //TMath::ATan2(fMomentum[1],fMomentum[0]); // fMom is pt,phi,theta!
} else { // outside the ITS
Float_t phiPos = TMath::Pi()+TMath::ATan2(-fPosition[1], -fPosition[0]);
alpha =
TMath::DegToRad()*(20*((((Int_t)(phiPos*TMath::RadToDeg()))/20))+10);
}
//
// Get the vertex of origin and the momentum
TVector3 ver(fPosition[0],fPosition[1],fPosition[2]);
TVector3 mom(Px(),Py(),Pz());
//
// Rotate to the local coordinate system
ver.RotateZ(-alpha);
mom.RotateZ(-alpha);
//
Double_t fx = ver.X();
Double_t fy = ver.Y();
Double_t fz = ver.Z();
Double_t sn = TMath::Sin(mom.Phi());
Double_t tgl = mom.Pz()/mom.Pt();
Double_t crv = TMath::Sign(1/mom.Pt(),(Double_t)fCharge)*bz*kB2C;
//
if ( (TMath::Abs(bz))<kAlmost0Field ) crv=0.;
//
// general circle parameterization:
// x = (r0+tR)cos(phi0) - tR cos(t+phi0)
// y = (r0+tR)sin(phi0) - tR sin(t+phi0)
// where qb is the sign of the curvature, tR is the track's signed radius and r0
// is the DCA of helix to origin
//
double tR = 1./crv; // track radius signed
double cs = TMath::Sqrt((1-sn)*(1+sn));
double x0 = fx - sn*tR; // helix center coordinates
double y0 = fy + cs*tR;
double phi0 = TMath::ATan2(y0,x0); // angle of PCA wrt to the origin
if (tR<0) phi0 += TMath::Pi();
if (phi0 > TMath::Pi()) phi0 -= 2.*TMath::Pi();
else if (phi0 <-TMath::Pi()) phi0 += 2.*TMath::Pi();
double cs0 = TMath::Cos(phi0);
double sn0 = TMath::Sin(phi0);
double r0 = x0*cs0 + y0*sn0 - tR; // DCA to origin
double r2R = 1.+r0/tR;
//
//
if (r2R<kAlmost0) return kFALSE; // helix is centered at the origin, no specific intersection with other concetric circle
if (!xyz && !alpSect) return kTRUE;
double xr2R = xr/tR;
double r2Ri = 1./r2R;
// the intersection cos(t) = [1 + (r0/tR+1)^2 - (r0/tR)^2]/[2(1+r0/tR)]
double cosT = 0.5*(r2R + (1-xr2R*xr2R)*r2Ri);
if ( TMath::Abs(cosT)>kAlmost1 ) {
// printf("Does not reach : %f %f\n",r0,tR);
return kFALSE; // track does not reach the radius xr
}
//
double t = TMath::ACos(cosT);
if (tR<0) t = -t;
// intersection point
double xyzi[3];
xyzi[0] = x0 - tR*TMath::Cos(t+phi0);
xyzi[1] = y0 - tR*TMath::Sin(t+phi0);
if (xyz) { // if postition is requested, then z is needed:
double t0 = TMath::ATan2(cs,-sn) - phi0;
double z0 = fz - t0*tR*tgl;
xyzi[2] = z0 + tR*t*tgl;
}
else xyzi[2] = 0;
//
Local2GlobalPosition(xyzi,alpha);
//
if (xyz) {
xyz[0] = xyzi[0];
xyz[1] = xyzi[1];
xyz[2] = xyzi[2];
}
//
if (alpSect) {
double &alp = *alpSect;
// determine the sector of crossing
double phiPos = TMath::Pi()+TMath::ATan2(-xyzi[1],-xyzi[0]);
int sect = ((Int_t)(phiPos*TMath::RadToDeg()))/20;
alp = TMath::DegToRad()*(20*sect+10);
double x2r,f1,f2,r1,r2,dx,dy2dx,yloc=0, ylocMax = xr*TMath::Tan(TMath::Pi()/18); // min max Y within sector at given X
//
while(1) {
Double_t ca=TMath::Cos(alp-alpha), sa=TMath::Sin(alp-alpha);
if ((cs*ca+sn*sa)<0) {
AliDebug(1,Form("Rotation to target sector impossible: local cos(phi) would become %.2f",cs*ca+sn*sa));
return kFALSE;
}
//
f1 = sn*ca - cs*sa;
if (TMath::Abs(f1) >= kAlmost1) {
AliDebug(1,Form("Rotation to target sector impossible: local sin(phi) would become %.2f",f1));
return kFALSE;
}
//
double tmpX = fx*ca + fy*sa;
double tmpY = -fx*sa + fy*ca;
//
// estimate Y at X=xr
dx=xr-tmpX;
x2r = crv*dx;
f2=f1 + x2r;
if (TMath::Abs(f2) >= kAlmost1) {
AliDebug(1,Form("Propagation in target sector failed ! %.10e",f2));
return kFALSE;
}
r1 = TMath::Sqrt((1.-f1)*(1.+f1));
r2 = TMath::Sqrt((1.-f2)*(1.+f2));
dy2dx = (f1+f2)/(r1+r2);
yloc = tmpY + dx*dy2dx;
if (yloc>ylocMax) {alp += 2*TMath::Pi()/18; sect++;}
else if (yloc<-ylocMax) {alp -= 2*TMath::Pi()/18; sect--;}
else break;
if (alp >= TMath::Pi()) alp -= 2*TMath::Pi();
else if (alp < -TMath::Pi()) alp += 2*TMath::Pi();
// if (sect>=18) sect = 0;
// if (sect<=0) sect = 17;
}
//
// if alpha was requested, then recalculate the position at intersection in sector
if (xyz) {
xyz[0] = xr;
xyz[1] = yloc;
if (TMath::Abs(x2r)<0.05) xyz[2] = fz + dx*(r2 + f2*dy2dx)*tgl;
else {
// for small dx/R the linear apporximation of the arc by the segment is OK,
// but at large dx/R the error is very large and leads to incorrect Z propagation
// angle traversed delta = 2*asin(dist_start_end / R / 2), hence the arc is: R*deltaPhi
// The dist_start_end is obtained from sqrt(dx^2+dy^2) = x/(r1+r2)*sqrt(2+f1*f2+r1*r2)
// Similarly, the rotation angle in linear in dx only for dx<<R
double chord = dx*TMath::Sqrt(1+dy2dx*dy2dx); // distance from old position to new one
double rot = 2*TMath::ASin(0.5*chord*crv); // angular difference seen from the circle center
xyz[2] = fz + rot/crv*tgl;
}
Local2GlobalPosition(xyz,alp);
}
}
return kTRUE;
//
}

//_______________________________________________________
void AliAODTrack::GetITSdEdxSamples(Double_t s[4]) const
Expand Down
3 changes: 2 additions & 1 deletion STEER/AOD/AliAODTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ class AliAODTrack : public AliVTrack {
return GetPosition(p); }

Bool_t GetXYZAt(Double_t x, Double_t b, Double_t *r) const;

Bool_t GetXYZatR(Double_t xr,Double_t bz, Double_t *xyz=0, Double_t* alpSect=0) const;

Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const {
return GetCovMatrix(cv);}

Expand Down
4 changes: 2 additions & 2 deletions STEER/ESD/AliVertexerTracks.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1029,13 +1029,13 @@ void AliVertexerTracks::SetCuts(Double_t *cuts, Int_t ncuts)
if (ncuts>17) if (cuts[17]>0.5) SetMVScanStep(cuts[17]);
if (ncuts>18) SetMVMaxWghNtr(cuts[18]);
if (ncuts>19) SetMVFinalWBinary(cuts[19]>0);
if (ncuts>20) if (cuts[20]>20.) SetBCSpacing(int(cuts[20]));
if (ncuts>20) SetBCSpacing(int(cuts[20]));
//
if (ncuts>21) if (cuts[21]>0.5) SetUseTrackClusterization(kTRUE);
if (ncuts>22) SetDeltaZCutForCluster(cuts[22]);
if (ncuts>23) SetnSigmaZCutForCluster(cuts[23]);
//
if (fAlgo==kMultiVertexer || fClusterize) SetSelectOnTOFBunchCrossing(kTRUE,kTRUE);
if ( (fAlgo==kMultiVertexer || fClusterize) && fBCSpacing>0) SetSelectOnTOFBunchCrossing(kTRUE,kTRUE);
else SetSelectOnTOFBunchCrossing(kFALSE,kTRUE);
//
return;
Expand Down
Loading

0 comments on commit 8ae1866

Please sign in to comment.