DSTUtil::Global Namespace Reference


Functions

float CombinedLL (int ipid, const MIPPTrackSummary *trk, const MIPPEventSummary *evt)
int SimplePID (const MIPPTrackSummary *trk, const MIPPEventSummary *evt, float &maxdLL)
int MomPID (const MIPPTrackSummary *trk, const MIPPEventSummary *evt, float &maxLL)


Function Documentation

float DSTUtil::Global::CombinedLL ( int  ipid,
const MIPPTrackSummary trk,
const MIPPEventSummary evt 
)

Definition at line 1581 of file DSTUtil.cxx.

References MIPPEventSummary::GetDCkov(), MIPPEventSummary::GetRICH(), MIPPEventSummary::GetToF(), MIPPEventSummary::GetTPC(), MIPPTrackSummary::idckov, MIPPTrackSummary::inDCkovFwin, MIPPTrackSummary::inrichFwin, MIPPTrackSummary::inrichRwin, MIPPTrackSummary::inToF, MIPPTrackSummary::irich, MIPPTrackSummary::itof, MIPPTrackSummary::itpc, MIPPToFSummary::LL, MIPPPIDSummary::LL, and MIPPTrackSummary::ntof.

01583 {
01584   float LL = 0.;
01585 
01586   if (trk->itpc >= 0) {
01587     MIPPTPCSummary* tpc = evt->GetTPC(trk->itpc);
01588     if (tpc) LL += tpc->LL[ipid];
01589   }
01590 
01591   if (trk->inToF && trk->ntof == 1) {
01592     MIPPToFSummary* tof = evt->GetToF(trk->itof[0]);
01593     if (tof) LL += tof->LL[ipid];
01594   }
01595 
01596   if (trk->inDCkovFwin && trk->idckov >= 0) {
01597     MIPPDCkovSummary* ckov = evt->GetDCkov(trk->idckov);
01598     if (ckov) LL += ckov->LL[ipid];
01599   }
01600   
01601   if (trk->inrichFwin && trk->inrichRwin && trk->irich >= 0) {
01602     MIPPRICHSummary* rich = evt->GetRICH(trk->irich);
01603     if (rich) LL += rich->LL[ipid];
01604   }
01605 
01606   return LL;
01607 }

int DSTUtil::Global::SimplePID ( const MIPPTrackSummary trk,
const MIPPEventSummary evt,
float &  maxdLL 
)

Definition at line 1618 of file DSTUtil.cxx.

References MIPPEventSummary::GetDCkov(), MIPPEventSummary::GetRICH(), MIPPEventSummary::GetToF(), MIPPEventSummary::GetTPC(), MIPPTrackSummary::idckov, MIPPTrackSummary::inDCkovFwin, MIPPTrackSummary::inrichFwin, MIPPTrackSummary::inrichRwin, MIPPTrackSummary::inToF, MIPPTrackSummary::irich, MIPPTrackSummary::itof, MIPPTrackSummary::itpc, PIDDef::kElectron, PIDDef::kProton, and MIPPTrackSummary::ntof.

01620 {
01621   float dLL[PIDDef::kProton];
01622   memset(dLL,0,sizeof(dLL));
01623 
01624   float LL[PIDDef::kProton+1];
01625   memset(LL,0,sizeof(LL));
01626 
01627   maxdLL = 0.;
01628   int j = -1;
01629 
01630   MIPPTPCSummary* tpc = 0;
01631   if (trk->itpc >= 0)
01632     tpc = evt->GetTPC(trk->itpc);
01633   
01634   MIPPToFSummary* tof = 0;
01635   if (trk->inToF && trk->ntof == 1)   
01636     tof = evt->GetToF(trk->itof[0]);
01637 
01638   MIPPDCkovSummary* ckov = 0;
01639   if (trk->inDCkovFwin && trk->idckov >= 0) 
01640     ckov = evt->GetDCkov(trk->idckov);
01641 
01642   MIPPRICHSummary* rich = 0;
01643   if (trk->inrichFwin && trk->inrichRwin && trk->irich >= 0) 
01644     rich = evt->GetRICH(trk->irich);
01645 
01646   int i = PIDDef::kElectron;
01647   for ( ; i<=PIDDef::kProton; ++i) {
01648 
01649     if (tpc)
01650       if (tpc->LL[i] > -100. && tpc->LL[i+1] > -100.) {
01651     if (i < PIDDef::kProton)
01652       dLL[i] += tpc->LL[i] - tpc->LL[i+1];
01653     LL[i] += tpc->LL[i];
01654       }
01655 
01656     if (tof)
01657       if (tof->LL[i] > -100. && tof->LL[i+1] > -100.) {
01658     if (i < PIDDef::kProton)
01659       dLL[i] += tof->LL[i] - tof->LL[i+1];
01660     LL[i] += tof->LL[i];
01661       }
01662 
01663     if (ckov)
01664       if (ckov->LL[i] > -100. && ckov->LL[i+1] > -100.) {
01665     if (i < PIDDef::kProton)
01666       dLL[i] += ckov->LL[i] - ckov->LL[i+1];
01667     LL[i] += ckov->LL[i];
01668       }
01669     
01670     if (rich)
01671       if (rich->LL[i] > -100. && rich->LL[i+1] > -100.) {
01672     if (i < PIDDef::kProton)
01673       dLL[i] += rich->LL[i] - rich->LL[i+1];
01674     LL[i] += rich->LL[i];
01675       }
01676     
01677     if ( (fabs(dLL[i]) > 0.) && (fabs(dLL[i]) > fabs(maxdLL)) ) {
01678       maxdLL = dLL[i];
01679       j = i;
01680     }
01681   }
01682   
01683   int ipid = j;
01684   if (maxdLL < 0) // this means the second particle is the more probable
01685     ipid = j+1;
01686 
01687   // now do some sanity checks before return ipid
01688 
01689   if ( (ipid > 0 && (LL[ipid] < LL[ipid-1])) || 
01690        (ipid < PIDDef::kProton && (LL[ipid] < LL[ipid+1])) ) {
01691     // in the (rare?) case where dLLs don't make sense, eg:
01692     // LL(pi) > LL(K) but LL(p) > LL(K), which we've seen in the RICH
01693     // choose PID based on greatest LL for a single PID detector (chosen by
01694     // momentum of the track)
01695     
01696     ipid = PIDDef::kUndef;
01697     
01698     i = PIDDef::kElectron;
01699     float maxLL = -1.e9;
01700 
01701     MIPPPIDSummary* pid = 0;
01702 
01703     if (rich && trk->ptot >= 20.) 
01704       pid = (MIPPPIDSummary*)rich;
01705     
01706     if (ckov && trk->ptot > 2.8 && trk->ptot < 20.)
01707       pid = (MIPPPIDSummary*)ckov;
01708 
01709     if (tof && trk->ptot > 0.7 && trk->ptot < 2.)
01710       pid = (MIPPPIDSummary*)tof;
01711 
01712     if (tpc && trk->ptot < 0.7 && trk->ptot > 0.2)
01713       pid = (MIPPPIDSummary*)tpc;
01714 
01715     if (pid)
01716       for (; i<=PIDDef::kProton; ++i)
01717     if (pid->LL[i] > maxLL) {
01718       maxLL = pid->LL[i];
01719       ipid = i;
01720     }
01721   }    
01722   
01723   return ipid;
01724   
01725 }

int DSTUtil::Global::MomPID ( const MIPPTrackSummary trk,
const MIPPEventSummary evt,
float &  maxLL 
)

Definition at line 1733 of file DSTUtil.cxx.

References MIPPEventSummary::GetRICH(), MIPPTrackSummary::irich, PIDDef::kProton, MIPPPIDSummary::LL, and MIPPTrackSummary::ptot.

01735 {
01736 
01737   maxLL = 0;
01738 
01739   if (trk->ptot > 40.) { // here we rely only on the RICH
01740     
01741     if (trk->irich >= 0) {
01742       MIPPRICHSummary* rich = evt->GetRICH(trk->irich);
01743       int j=-1;
01744       for (int i=0; i<=PIDDef::kProton; ++i) {
01745     if (rich->LL[i] > maxLL) {
01746       maxLL = rich->LL[i];
01747       j = i;
01748     }
01749       }
01750       return j;
01751     }    
01752   }
01753     
01754   if (trk->ptot > 20. && trk->ptot <= 40.) { // here we again rely on the RICH
01755     if (trk->irich >= 0) {
01756       MIPPRICHSummary* rich = evt->GetRICH(trk->irich);
01757 
01758       if ((rich->LL[PIDDef::kPion] > rich->LL[PIDDef::kKaon]) &&
01759       (rich->LL[PIDDef::kPion] > rich->LL[PIDDef::kProton])) {
01760     maxLL = rich->LL[PIDDef::kPion];
01761     return PIDDef::kPion;
01762       }
01763 
01764       if((rich->LL[PIDDef::kKaon] > rich->LL[PIDDef::kPion]) &&
01765      (rich->LL[PIDDef::kKaon] > rich->LL[PIDDef::kProton])) {
01766     maxLL = rich->LL[PIDDef::kKaon];
01767     return PIDDef::kKaon;
01768       }  
01769     }
01770     else {
01771       // absence of a ring indicates we have a proton
01772       if (trk->inrichFwin && trk->inrichRwin)
01773     return PIDDef::kProton;      
01774     }
01775   }
01776 
01777   // the following momentum range is covered by both TPC and ToF
01778   if (trk->ptot < 2.6) {
01779     float dLL;
01780     MIPPTPCSummary* tpc = 0;
01781     MIPPToFSummary* tof = 0;
01782     if (trk->itpc >= 0)
01783       tpc = evt->GetTPC(trk->itpc);
01784     if (trk->ntof == 1 && trk->inToF)
01785       tof = evt->GetToF(trk->itof[0]);
01786 
01787     if (tpc || tof) {
01788       int j=-1;
01789       for (int i=PIDDef::kElectron; i<PIDDef::kProton; ++i) {
01790     dLL = 0.;
01791     
01792     if (tpc)
01793       if (tpc->LL[i] > -100. && tpc->LL[i+1] > -100.)
01794         dLL += tpc->LL[i] - tpc->LL[i+1];
01795     if (tof)
01796       if (tof->LL[i] > -100. && tof->LL[i+1] > -100.)
01797         dLL += tof->LL[i] - tof->LL[i+1];
01798 
01799     if ( (fabs(dLL) > 0.) && (fabs(dLL) > fabs(maxLL)) ) {
01800       maxLL = dLL;
01801       j = i;
01802     }
01803       }
01804       
01805       if (maxLL < 0)  // this means the second particle is the more probable
01806     return j+1;
01807       else
01808     return j;
01809     }
01810   }
01811 
01812   if (trk->ptot >= 2.6 && trk->ptot < 9.) {
01813     //float dLL;
01814     MIPPDCkovSummary* ckov = 0;
01815     MIPPRICHSummary* rich = 0;
01816     if (trk->idckov >= 0 && trk->inDCkovFwin)
01817       ckov = evt->GetDCkov(trk->idckov);
01818     if (trk->irich >= 0 && trk->inrichFwin)
01819       rich = evt->GetRICH(trk->irich);
01820     /*    
01821     // we should be able to do e/pi separation
01822     if (trk->ptot < 5.) { // here we are below RICH pi threshold
01823       if (rich && ckov)
01824     if ((rich->LL[PIDDef::kElectron] > rich->LL[PIDDef::kPion]) &&
01825         (ckov->LL[PIDDef::kElectron]
01826 
01827     }
01828     */
01829   }
01830 
01831   return -1;
01832 
01833 }


Generated on Mon Nov 23 08:05:24 2009 for MIPP(E907) by  doxygen 1.4.7