Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CDMapMaker.cxx

Go to the documentation of this file.
00001 
00002 
00003 // Program name: CDMapMaker.cxx                
00004 //                                                  
00005 // Package: CalDetTracker
00006 //                                                                    
00007 // Purpose: 
00008 //                                                                    
00009 // Contact: Chris Smith, Ryan Nichol, Leo Jenner or Jeff Hartnell 
00011 
00012 #include "Conventions/ReadoutType.h"
00013 #include "MessageService/MsgService.h"
00014 #include "Plex/PlexStripEndId.h"
00015 
00016 #include "CalDetTracker/CDMapMaker.h"
00017 
00018 CVSID("$Id: CDMapMaker.cxx,v 1.5 2003/10/12 19:41:31 cbs Exp $");
00019 
00020 //......................................................................
00021 
00022 CDMapMaker::CDMapMaker()
00023 {   
00024   //default constructor
00025   fcdlh=0;  
00026   fcslh=0;
00027 }
00028 
00029 //......................................................................
00030 
00031 CDMapMaker::CDMapMaker(CandDigitListHandle *cdlh)
00032 {  
00033   if(!this->SetDigitList(cdlh)){
00034     MSG("CDMapMaker",Msg::kFatal)
00035       << "No Digit List" <<endl;
00036   }
00037 }
00038 
00039 //......................................................................
00040 
00041 CDMapMaker::CDMapMaker(CandStripListHandle *cslh)
00042 {  
00043   if(!this->SetStripList(cslh)){
00044     MSG("CDMapMaker",Msg::kFatal)
00045       << "No Strip List" <<endl;
00046   }
00047 }
00048 
00049 //......................................................................
00050 
00051 map<int,CandDigitHandle> CDMapMaker::GetDigitMap()
00052 {  
00053   map<int,CandDigitHandle> digitmap;
00054 
00055   //check that list handle is real
00056   if (fcdlh==0){
00057     MSG("CDMapMaker",Msg::kFatal)
00058       << "No digit list set" <<endl;
00059     return digitmap;
00060   }
00061 
00062   TIter cdhItr(fcdlh->GetDaughterIterator());
00063   while (CandDigitHandle *digit=
00064          dynamic_cast<CandDigitHandle*>(cdhItr())){
00065     
00066     int theKey = digit->GetPlexSEIdAltL().GetBestSEId().
00067       BuildPlnStripEndKey();
00068     
00069     if(digit->GetChannelId().GetElecType()==ElecType::kQIE){
00070       MSG("CDMapMaker",Msg::kVerbose) << "Got a QIE digit" << std::endl;
00071       if(digitmap.find(theKey)==digitmap.end()) {
00072         digitmap[theKey] = *digit;
00073       }
00074     }
00075     else {
00076       digitmap[theKey] = *digit;
00077     }
00078   }
00079 
00080   return digitmap;
00081 }
00082 
00083 //......................................................................
00084 
00085 map<int,CandStripHandle> CDMapMaker::GetStripMap()
00086 {
00087   //This method makes the map and returns it
00088   map<int,CandStripHandle> stripmap;
00089 
00090   //check that list handle is real
00091   if (fcslh==0){
00092     MSG("CDMapMaker",Msg::kFatal)
00093       << "No strip list set" <<endl;
00094     return stripmap;
00095   }
00096   
00097   TIter cshItr(fcslh->GetDaughterIterator());
00098   
00099   //loop over all the candStrips
00100   while (CandStripHandle *csh=dynamic_cast<CandStripHandle*>(cshItr())){
00101     int theKey = -1;
00102     //theKey=csh->GetStripEndId().BuildPlnStripEndKey();
00103     theKey=csh->GetStripEndId().Build18BitPlnStripKey();
00104 
00105     //store key and associated csh in map
00106     if (theKey!=-1) stripmap[theKey]=*csh;    
00107     else MSG("CDTracker",Msg::kWarning)<<"Bad StripEndKey"<<endl;
00108   }
00109   return stripmap;  
00110 }
00111 
00112 //......................................................................
00113 
00114 int CDMapMaker::SetDigitList(CandDigitListHandle *cdlh)
00115 {
00116   if(cdlh!=0){
00117     fcdlh=cdlh;
00118     return 1;
00119   }
00120   else return 0;
00121 }
00122 
00123 //......................................................................
00124 
00125 int CDMapMaker::SetStripList(CandStripListHandle *cslh)
00126 {
00127   if(cslh!=0){
00128     fcslh=cslh;
00129     return 1;
00130   }
00131   else return 0;
00132 }
00133 
00134 //......................................................................
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 

Generated on Mon Feb 15 11:06:30 2010 for loon by  doxygen 1.3.9.1