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

AtNuDisplayModule.cxx

Go to the documentation of this file.
00001 
00002 #include "AtNuDisplayModule.h"
00003 #include "CandTrackAtNuListHandle.h"
00004 #include "CandTrackAtNuHandle.h"
00005 #include "CandShowerAtNuListHandle.h"
00006 #include "CandShowerAtNuHandle.h"
00007 
00008 #include "MessageService/MsgService.h"  
00009 #include "JobControl/JobCModuleRegistry.h"
00010 #include "JobControl/JobCommand.h"
00011 #include "MinosObjectMap/MomNavigator.h"
00012 
00013 #include "RerootExodus/RerootExodus.h"
00014 #include "REROOT_Classes/REROOT_NeuKin.h"
00015 #include "Record/SimSnarlRecord.h"
00016 #include "Record/SimSnarlHeader.h"
00017 
00018 #include "RawData/RawRecord.h"
00019 #include "RawData/RawDaqSnarlHeader.h"
00020 
00021 #include "CandData/CandRecord.h"
00022 #include "CandData/CandHeader.h"
00023 #include "CandDigit/CandDeMuxDigitHandle.h"
00024 #include "CandDigit/CandDeMuxDigitListHandle.h"
00025 #include "RecoBase/CandStripHandle.h"
00026 #include "RecoBase/CandStripListHandle.h"
00027 
00028 #include "UgliGeometry/UgliGeomHandle.h"
00029 #include "UgliGeometry/UgliPlnNode.h"
00030 #include "Validity/VldContext.h"
00031 #include "Plex/PlexPlaneId.h"
00032 
00033 #include "TStyle.h"
00034 #include "TPolyMarker.h"
00035 #include "TDirectory.h"
00036 #include "TLegend.h"
00037 #include "TLatex.h"
00038 #include "TH1.h"
00039 #include "TF1.h"
00040 
00041 CVSID("$Id: AtNuDisplayModule.cxx,v 1.6 2006/05/22 16:44:42 rhatcher Exp $");
00042 
00043 JOBMODULE(AtNuDisplayModule,"AtNuDisplayModule","Displaying CandTracks and CandShowers");
00044 
00045 
00046 AtNuDisplayModule::AtNuDisplayModule() : 
00047   fCanvas(0), 
00048   fUZpad(0),fVZpad(0),fXYpad(0),
00049   fTpad(0),fQpad(0), fTitlePad(0),
00050   fUviewDis1(0), fVviewDis1(0),fXYdisplay(0), 
00051   fTimeDisplay(0),
00052   fDetOutline(0), fDetOutlineC(0),
00053   fVeto1(0), fVeto2(0), fVeto3(0), fVeto4(0), fVeto5(0),
00054   fListInTrk("CandTrackAtNuListHandle"), fListInShw("CandShowerAtNuListHandle"), 
00055   fListInStrp("CandStripListHandle")
00056 {
00057    
00058 }
00059 
00060 AtNuDisplayModule::~AtNuDisplayModule()
00061 {
00062   MSG("AtNuDisplayModule",Msg::kDebug) << " *** AtNuDisplayModule::~AtNuDisplayModule() *** " << endl;
00063   if(fUviewDis1) delete fUviewDis1; 
00064   if(fVviewDis1) delete fVviewDis1;
00065   if(fXYdisplay) delete fXYdisplay;
00066   if(fTimeDisplay) delete fTimeDisplay;
00067   if(fDetOutline) delete fDetOutline;
00068   if(fDetOutlineC) delete fDetOutlineC;
00069   if(fVeto1) delete fVeto1;
00070   if(fVeto2) delete fVeto2;
00071   if(fVeto3) delete fVeto3;
00072   if(fVeto4) delete fVeto4;
00073   if(fVeto5) delete fVeto5;
00074   if(fUZpad) delete fUZpad;
00075   if(fVZpad) delete fVZpad;
00076   if(fXYpad) delete fXYpad;
00077   if(fTpad) delete fTpad;
00078   if(fQpad) delete fQpad;
00079   if(fTitlePad) delete fTitlePad;
00080   if(fCanvas) delete fCanvas;   
00081   MSG("AtNuDisplayModule",Msg::kDebug) << " -*- goodbye -*- " << endl;
00082 }
00083 
00084 void AtNuDisplayModule::BeginJob()
00085 {
00086   
00087   gStyle->SetOptStat(0);
00088   gStyle->SetPadBorderMode(0);
00089 
00090   fCanvas = new TCanvas("Canvas","Canvas",1050,600);
00091 
00092   fUZpad = new TPad("fUZpad","fUZpad",0.01,0.51,0.29,0.99);
00093   fVZpad = new TPad("fVZpad","fVZpad",0.01,0.01,0.29,0.49);
00094   fXYpad = new TPad("fXYpad","fXYpad",0.30,0.01,0.70,0.75);
00095   fTpad = new TPad("fTpad","fTpad",0.71,0.51,0.99,0.99);
00096   fQpad = new TPad("fQpad","fQpad",0.71,0.01,0.99,0.49);
00097   fTitlePad = new TPad("fTitlePad","fTitlePad",0.30,0.76,0.70,0.99);
00098 
00099   fTimeDisplay = new TH2D("TimeDisplay","TimeDisplay",1,0.0,10.0,1,0.0,10.0);
00100   fTimeDisplay->SetStats(kFALSE); fTimeDisplay->SetDirectory(0); 
00101 
00102   fUviewDis1 = new TH2D("UviewDis1","UviewDis1",1,0.0,500.0,1,0.0,192.0);
00103   fVviewDis1 = new TH2D("VviewDis1","VviewDis1",1,0.0,500.0,1,0.0,192.0);
00104   fUviewDis1->SetStats(kFALSE); fVviewDis1->SetStats(kFALSE);
00105   fUviewDis1->SetDirectory(0); fVviewDis1->SetDirectory(0);
00106 
00107   fXYdisplay = new TH2D("fXYdisplay","fXYdisplay",1,-5.0,5.0,1,-5.0,5.0);
00108   fXYdisplay->SetStats(kFALSE); fXYdisplay->SetDirectory(0);
00109 
00110   Double_t x[9],y[9];
00111 
00112   x[0] = -1.65;
00113   x[1] = +1.64;
00114   x[2] = +4;
00115   x[3] = +4;
00116   x[4] = +1.65;
00117   x[5] = -1.65;
00118   x[6] = -4;
00119   x[7] = -4;
00120   x[8] = -1.65;
00121 
00122   y[0] = -4;
00123   y[1] = -4;
00124   y[2] = -1.65;
00125   y[3] = +1.65;
00126   y[4] = +4;
00127   y[5] = +4;
00128   y[6] = +1.65;
00129   y[7] = -1.65;
00130   y[8] = -4;
00131 
00132   fDetOutline = new TPolyLine(9,x,y);
00133 
00134   x[0] = -1.44375;
00135   x[1] = +1.44375;
00136   x[2] = +3.5;
00137   x[3] = +3.5;
00138   x[4] = +1.44375;
00139   x[5] = -1.44375;
00140   x[6] = -3.5;
00141   x[7] = -3.5;
00142   x[8] = -1.44375;
00143 
00144   y[0] = -3.5;
00145   y[1] = -3.5;
00146   y[2] = -1.44375;
00147   y[3] = +1.44375;
00148   y[4] = +3.5;
00149   y[5] = +3.5;
00150   y[6] = +1.44375;
00151   y[7] = -1.44375;
00152   y[8] = -3.5;
00153   
00154   fDetOutlineC = new TPolyLine(9,x,y);
00155   fDetOutlineC->SetLineStyle(2);
00156 
00157   Double_t xx[10],yy[10];
00158 
00159   xx[0] = -4.25;
00160   xx[1] = -4.25;
00161   yy[0] = -1.42;
00162   yy[1] =  0.22;
00163   fVeto1 = new TPolyLine(2,xx,yy);
00164   
00165   xx[0] = +4.25;
00166   xx[1] = +4.25;
00167   yy[0] = -1.42;
00168   yy[1] =  0.22;
00169   fVeto2 = new TPolyLine(2,xx,yy);
00170   
00171   xx[0] = -6.97;
00172   xx[1] = -6.97;
00173   xx[2] = -6.49;
00174   yy[0] =  1.21;
00175   yy[1] =  3.68;
00176   yy[2] =  4.36;
00177   fVeto3 = new TPolyLine(3,xx,yy);
00178 
00179   xx[0] = +6.97;
00180   xx[1] = +6.97;
00181   xx[2] = +6.49;
00182   yy[0] =  1.21;
00183   yy[1] =  3.68;
00184   yy[2] =  4.36;
00185   fVeto4 = new TPolyLine(3,xx,yy);
00186 
00187   xx[0] = -5.66;
00188   xx[1] = -3.17;
00189   xx[2] = -2.01;
00190   xx[3] = +2.01;
00191   xx[4] = +3.17;
00192   xx[5] = +5.66;
00193   yy[0] =  2.96;
00194   yy[1] =  2.96;
00195   yy[2] =  4.35;
00196   yy[3] =  4.35;
00197   yy[4] =  2.96;
00198   yy[5] =  2.96;
00199   fVeto5 = new TPolyLine(6,xx,yy);
00200 
00201 
00202   fUZpad->Draw();
00203   fVZpad->Draw();
00204   fXYpad->Draw();
00205   fTpad->Draw();
00206   fQpad->Draw();
00207   fTitlePad->Draw();
00208 
00209   fCanvas->Draw();
00210 
00211   fUZpad->cd();
00212   fUviewDis1->Draw();
00213   fUviewDis1->SetTitle("U vs Z");
00214   fUviewDis1->GetXaxis()->SetTitle("plane");
00215   fUviewDis1->GetYaxis()->SetTitle("strip");
00216   
00217   fVZpad->cd();
00218   fVviewDis1->Draw();
00219   fVviewDis1->SetTitle("V vs Z");
00220   fVviewDis1->GetXaxis()->SetTitle("plane");
00221   fVviewDis1->GetYaxis()->SetTitle("strip");
00222 
00223   fXYpad->cd();
00224   fXYdisplay->Draw();
00225   fXYdisplay->SetTitle("Y vs X");
00226   fXYdisplay->GetXaxis()->SetTitle("X / m");
00227   fXYdisplay->GetYaxis()->SetTitle("Y / m");
00228   fDetOutline->Draw();
00229   fDetOutlineC->Draw();
00230   
00231   fTpad->cd();
00232   fTimeDisplay->Draw();
00233   fTimeDisplay->SetTitle("CT vs S");
00234   fTimeDisplay->GetXaxis()->SetTitle("S / m");
00235   fTimeDisplay->GetYaxis()->SetTitle("CT / m");
00236 
00237   fQpad->cd();
00238 
00239   fCanvas->Update();
00240 
00241 }
00242 
00243 
00244 JobCResult AtNuDisplayModule::Ana(const MomNavigator* mom)
00245 {
00246 
00247   MSG("AtNuDisplayModule",Msg::kInfo) << " *** AtNuDisplayModule::Ana( ) *** " << endl;
00248 
00249   JobCResult result(JobCResult::kPassed);
00250 
00251   Int_t fSave=1;
00252   Int_t fSpaceDisplay=0;
00253   Int_t fTimingDisplay=0;
00254 
00255   Int_t Run=-1,Snarl=-1;
00256   Int_t i;
00257   Int_t bpln,epln,pln,npln;
00258 
00259   // Get SimSnarlRecord
00260   SimSnarlRecord* simrec = dynamic_cast<SimSnarlRecord *>(mom->GetFragment("SimSnarlRecord"));
00261   if(simrec){
00262 
00263     if(Run<0) Run=RerootExodus::GetRunNo();
00264     if(Snarl<0) Snarl=RerootExodus::GetEventNo();
00265 
00266     const SimSnarlHeader* hdr = dynamic_cast<const SimSnarlHeader*>(simrec->GetSimSnarlHeader());
00267     if(hdr){
00268       if(Run<0) Run = hdr->GetRun(); 
00269       if(Snarl<0) Snarl = hdr->GetSnarl(); 
00270     }
00271   }
00272 
00273   // GetRawRecord
00274   RawRecord *rawrec = dynamic_cast<RawRecord *>(mom->GetFragment("RawRecord"));
00275   if(rawrec){
00276     const RawDaqSnarlHeader* hdr = dynamic_cast<const RawDaqSnarlHeader*>(rawrec->GetRawHeader());
00277     if(hdr){
00278       if(Run<0) Run = hdr->GetRun(); 
00279       if(Snarl<0) Snarl = hdr->GetSnarl();  
00280     }
00281   }
00282   else return result.SetFailed();
00283 
00284   // Get Candidate record  
00285   CandRecord* candrec = dynamic_cast<CandRecord*>(mom->GetFragment("CandRecord","PrimaryCandidateRecord"));
00286   if(candrec){
00287   
00288   }
00289   else return result.SetFailed();
00290 
00291   // Get Geometry
00292   VldContext *vldc = (VldContext*)(candrec->GetVldContext());
00293   UgliGeomHandle ugh(*vldc);
00294 
00295   // Get StripList
00296   CandStripListHandle* strplist = dynamic_cast<CandStripListHandle*>(candrec->FindCandHandle("CandStripListHandle",fListInStrp.Data()));
00297 
00298   TPolyMarker* uSTR = 0; 
00299   TPolyMarker* uXTALK = 0;
00300   TPolyMarker* uSHW = 0; 
00301   TPolyMarker* uTRK = 0;
00302   TLegend* leg = 0;
00303 
00304   TPolyMarker* vSTR = 0; 
00305   TPolyMarker* vXTALK = 0;
00306   TPolyMarker* vSHW = 0; 
00307   TPolyMarker* vTRK = 0;
00308 
00309   TPolyMarker* SHLD1 = 0;
00310   TPolyMarker* SHLD2 = 0;
00311   TPolyMarker* SHLD3 = 0;
00312 
00313   TPolyMarker* strpXY1 = 0;
00314   TPolyMarker* strpXY2 = 0;
00315   TPolyMarker* strpXY3 = 0;
00316 
00317   TH1D* Qhist = 0;
00318 
00319   TPolyMarker* plotu = 0;
00320   TPolyMarker* plotv = 0;
00321   TF1* fct = 0;
00322   TLegend* leg1 = 0;
00323 
00324   MSG("AtNuDisplayModule",Msg::kInfo) << " *** Run=" << Run << "  Snarl=" << Snarl << " *** " << endl;
00325 
00326 
00327   /*****************************
00328    * S P A C E   D I S P L A Y *
00329    *****************************/
00330 
00331   MSG("AtNuDisplayModule",Msg::kDebug) << " *** SPACE DISPLAY *** " << endl;
00332 
00333   // Get CandXXXListHandles
00334   CandTrackAtNuListHandle* trklist = dynamic_cast<CandTrackAtNuListHandle*>(candrec->FindCandHandle("CandTrackAtNuListHandle",fListInTrk.Data()));
00335   if(trklist){
00336     MSG("AtNuDisplayModule",Msg::kDebug) << " found track list : " << trklist->GetName() << endl;
00337   }
00338 
00339   CandShowerAtNuListHandle* shwlist = dynamic_cast<CandShowerAtNuListHandle*>(candrec->FindCandHandle("CandShowerAtNuListHandle",fListInShw.Data()));
00340   if(shwlist){
00341     MSG("AtNuDisplayModule",Msg::kDebug) << " found shower list : " << shwlist->GetName() << endl;
00342   }
00343 
00344   if(strplist){
00345 
00346     Int_t nbins=strplist->GetNDaughters();
00347     Double_t* Ustr = new Double_t[nbins];
00348     Double_t* Vstr = new Double_t[nbins];
00349     Double_t* Zstr = new Double_t[nbins]; 
00350     Int_t Nstr=0;
00351 
00352     Double_t* Utrk = new Double_t[nbins];
00353     Double_t* Vtrk = new Double_t[nbins];
00354     Double_t* Ztrk = new Double_t[nbins]; 
00355     Int_t Ntrk=0;
00356 
00357     Double_t* Ushw = new Double_t[nbins];
00358     Double_t* Vshw = new Double_t[nbins];
00359     Double_t* Zshw = new Double_t[nbins]; 
00360     Int_t Nshw=0;
00361 
00362     Double_t* Uxtalk = new Double_t[nbins];
00363     Double_t* Vxtalk = new Double_t[nbins];
00364     Double_t* Zxtalk = new Double_t[nbins]; 
00365     Int_t Nxtalk=0;
00366 
00367     Int_t begstrU=200,endstrU=0,begstrV=200,endstrV=0;
00368     Int_t begplnZ=500,endplnZ=0;
00369   
00370     Int_t xtalk;
00371 
00372     // Strips
00373     TIter stritr(strplist->GetDaughterIterator());
00374     while(CandStripHandle* str = dynamic_cast<CandStripHandle*>(stritr())){
00375 
00376       xtalk=0;
00377       TIter digitr(str->GetDaughterIterator());
00378       while(CandDeMuxDigitHandle* digit = (CandDeMuxDigitHandle*)(digitr())){
00379         if( ( digit->GetDeMuxDigitFlagWord()<8
00380           && (digit->GetDeMuxDigitFlagWord() & CandDeMuxDigit::kXTalk)==(CandDeMuxDigit::kXTalk) )
00381          || str->GetCharge()<2.0 ){
00382           xtalk=1; 
00383         }
00384       }
00385 
00386       if(str->GetPlaneView()==PlaneView::kU){
00387         if(str->GetCharge()>6.0){
00388           if(str->GetStrip()<begstrU) begstrU=str->GetStrip();
00389           if(str->GetStrip()>endstrU) endstrU=str->GetStrip();
00390           if(str->GetPlane()<begplnZ) begplnZ=str->GetPlane();
00391           if(str->GetPlane()>endplnZ) endplnZ=str->GetPlane();
00392         }
00393         if(Nstr<nbins){
00394           Ustr[Nstr]=str->GetStrip();
00395           Vstr[Nstr]=-999.0;
00396           Zstr[Nstr]=str->GetPlane();
00397           Nstr++;
00398         } 
00399         if(xtalk){
00400           if(Nxtalk<nbins){
00401             Uxtalk[Nxtalk]=str->GetStrip();
00402             Vxtalk[Nxtalk]=-999.0;
00403             Zxtalk[Nxtalk]=str->GetPlane();
00404             Nxtalk++;
00405           }   
00406         }
00407       }
00408       if(str->GetPlaneView()==PlaneView::kV){
00409         if(str->GetCharge()>6.0){
00410           if(str->GetStrip()<begstrV) begstrV=str->GetStrip();
00411           if(str->GetStrip()>endstrV) endstrV=str->GetStrip();
00412           if(str->GetPlane()<begplnZ) begplnZ=str->GetPlane();
00413           if(str->GetPlane()>endplnZ) endplnZ=str->GetPlane();
00414         }
00415         if(Nstr<nbins){
00416           Ustr[Nstr]=-999.0;
00417           Vstr[Nstr]=str->GetStrip();
00418           Zstr[Nstr]=str->GetPlane();
00419           Nstr++;
00420         }
00421         if(xtalk){
00422           if(Nxtalk<nbins){
00423             Uxtalk[Nxtalk]=-999;
00424             Vxtalk[Nxtalk]=str->GetStrip();
00425             Zxtalk[Nxtalk]=str->GetPlane();
00426             Nxtalk++;
00427           }   
00428         }
00429       }
00430     }
00431 
00432     // Tracks
00433     if(trklist){
00434       TIter trkitr(trklist->GetDaughterIterator());
00435       while(CandTrackAtNuHandle* trk = dynamic_cast<CandTrackAtNuHandle*>(trkitr())){
00436         if(trk){
00437           TIter itr(trk->GetDaughterIterator());
00438           while(CandStripHandle* str = dynamic_cast<CandStripHandle*>(itr())){
00439             if(str->GetPlaneView()==PlaneView::kU){
00440               if(str->GetStrip()<begstrU) begstrU=str->GetStrip();
00441               if(str->GetStrip()>endstrU) endstrU=str->GetStrip();
00442               if(str->GetPlane()<begplnZ) begplnZ=str->GetPlane();
00443               if(str->GetPlane()>endplnZ) endplnZ=str->GetPlane();
00444               if(Ntrk<nbins){
00445                 Utrk[Ntrk]=str->GetStrip();
00446                 Vtrk[Ntrk]=-999.0;
00447                 Ztrk[Ntrk]=str->GetPlane();
00448                 Ntrk++; 
00449               } 
00450             }
00451             if(str->GetPlaneView()==PlaneView::kV){
00452               if(str->GetStrip()<begstrV) begstrV=str->GetStrip();
00453               if(str->GetStrip()>endstrV) endstrV=str->GetStrip();
00454               if(str->GetPlane()<begplnZ) begplnZ=str->GetPlane();
00455               if(str->GetPlane()>endplnZ) endplnZ=str->GetPlane();
00456               if(Ntrk<nbins){
00457                 Utrk[Ntrk]=-999.0;
00458                 Vtrk[Ntrk]=str->GetStrip();
00459                 Ztrk[Ntrk]=str->GetPlane();
00460                 Ntrk++;
00461               }
00462             }
00463           }
00464         }
00465       }
00466     }
00467 
00468     // Showers
00469     if(shwlist){
00470       TIter shwitr(shwlist->GetDaughterIterator());
00471       while(CandShowerAtNuHandle* shw = dynamic_cast<CandShowerAtNuHandle*>(shwitr())){
00472         if(shw){
00473           TIter itr(shw->GetDaughterIterator());
00474           while(CandStripHandle* str = dynamic_cast<CandStripHandle*>(itr())){
00475             if(str->GetPlaneView()==PlaneView::kU){
00476               if(Nshw<nbins){
00477                 Ushw[Nshw]=str->GetStrip();
00478                 Vshw[Nshw]=-999.0;
00479                 Zshw[Nshw]=str->GetPlane();
00480                 Nshw++;
00481               } 
00482             }
00483             if(str->GetPlaneView()==PlaneView::kV){
00484               if(Nshw<nbins){
00485                 Ushw[Nshw]=-999.0;
00486                 Vshw[Nshw]=str->GetStrip();
00487                 Zshw[Nshw]=str->GetPlane();
00488                 Nshw++;
00489               }
00490             }
00491           }
00492         }
00493       }
00494     }
00495 
00496     // Draw
00497     Double_t teff,zeff,dL;
00498     if(1+endplnZ-begplnZ>0){
00499       zeff = endplnZ-begplnZ+2.0;
00500       teff = 1.5*(endplnZ-begplnZ);
00501       if(endstrV-begstrV>teff) teff=endstrV-begstrV+2.0;
00502       if(endstrU-begstrU>teff) teff=endstrU-begstrU+2.0;
00503       if(0.66*(endstrV-begstrV)>zeff) zeff=0.66*(endstrV-begstrV)+2.0;
00504       if(0.66*(endstrU-begstrU)>zeff) zeff=0.66*(endstrV-begstrV)+2.0;
00505       if(zeff>endplnZ-begplnZ){
00506         dL=0.5*(zeff-endplnZ+begplnZ);
00507         endplnZ=(int)(endplnZ+dL); begplnZ=(int)(begplnZ-dL);
00508       }
00509       if(teff>endstrV-begstrV){
00510         dL=0.5*(teff-endstrV+begstrV);
00511         endstrV=(int)(endstrV+dL); begstrV=(int)(begstrV-dL);
00512       }
00513       if(teff>endstrU-begstrU){
00514         dL=0.5*(teff-endstrU+begstrU);
00515         endstrU=(int)(endstrU+dL); begstrU=(int)(begstrU-dL);
00516       }
00517     }
00518 
00519     if(endplnZ-begplnZ<=0){ 
00520       begplnZ=0; endplnZ=500;
00521       begstrU=0; endstrU=200; 
00522       begstrV=0; endstrV=200; 
00523     }
00524 
00525     if(0){
00526       begstrU=0; endstrU=200;
00527       begstrV=0; endstrV=200;
00528       begplnZ=0; endplnZ=500;
00529     }
00530 
00531     if(Nstr==0){
00532       Nstr=1; Ustr[0]=-100; Vstr[0]=-100; Zstr[0]=-100;
00533     }
00534     if(Nxtalk==0){
00535       Nxtalk=1; Uxtalk[0]=-100; Vxtalk[0]=-100; Zxtalk[0]=-100;
00536     }
00537 
00538     if(Ntrk==0){
00539       Ntrk=1; Utrk[0]=-100; Vtrk[0]=-100; Ztrk[0]=-100;
00540     }
00541     if(Nshw==0){
00542       Nshw=1; Ushw[0]=-100; Vshw[0]=-100; Zshw[0]=-100;
00543     }
00544 
00545     uSTR = new TPolyMarker(Nstr,Zstr,Ustr);
00546     uSTR->SetMarkerColor(9);
00547     uSTR->SetMarkerStyle(4);
00548     uSTR->SetMarkerSize(1.5);
00549     uXTALK = new TPolyMarker(Nxtalk,Zxtalk,Uxtalk);
00550     uXTALK->SetMarkerColor(6);
00551     uXTALK->SetMarkerStyle(4);
00552     uXTALK->SetMarkerSize(1.5);
00553 
00554     uTRK = new TPolyMarker(Ntrk,Ztrk,Utrk);
00555     uTRK->SetMarkerColor(3);
00556     uTRK->SetMarkerStyle(20);
00557     uTRK->SetMarkerSize(1.5);
00558     uSHW = new TPolyMarker(Nshw,Zshw,Ushw);
00559     uSHW->SetMarkerColor(2);
00560     uSHW->SetMarkerStyle(20);
00561     uSHW->SetMarkerSize(1.5);
00562 
00563     fUviewDis1->GetXaxis()->SetLimits(begplnZ,endplnZ);
00564     fUviewDis1->GetYaxis()->SetLimits(begstrU,endstrU);
00565     
00566     vSTR = new TPolyMarker(Nstr,Zstr,Vstr);
00567     vSTR->SetMarkerColor(9);
00568     vSTR->SetMarkerStyle(4);
00569     vSTR->SetMarkerSize(1.5);
00570     vXTALK = new TPolyMarker(Nxtalk,Zxtalk,Vxtalk);
00571     vXTALK->SetMarkerColor(6);
00572     vXTALK->SetMarkerStyle(4);
00573     vXTALK->SetMarkerSize(1.5);
00574 
00575     vTRK = new TPolyMarker(Ntrk,Ztrk,Vtrk);
00576     vTRK->SetMarkerColor(3);
00577     vTRK->SetMarkerStyle(20);
00578     vTRK->SetMarkerSize(1.5);
00579     vSHW = new TPolyMarker(Nshw,Zshw,Vshw);
00580     vSHW->SetMarkerColor(2);
00581     vSHW->SetMarkerStyle(20);
00582     vSHW->SetMarkerSize(1.5);
00583 
00584     fVviewDis1->GetXaxis()->SetLimits(begplnZ,endplnZ);
00585     fVviewDis1->GetYaxis()->SetLimits(begstrV,endstrV);
00586 
00587     delete [] Ustr;
00588     delete [] Vstr;
00589     delete [] Zstr;
00590 
00591     delete [] Utrk;
00592     delete [] Vtrk;
00593     delete [] Ztrk;
00594 
00595     delete [] Ushw;
00596     delete [] Vshw;
00597     delete [] Zshw;
00598 
00599     delete [] Uxtalk;
00600     delete [] Vxtalk;
00601     delete [] Zxtalk;
00602 
00603     if(Nstr>2) fSpaceDisplay=1;
00604 
00605   }
00606 
00607 
00608   /*************************
00609    * S H I E L D   H I T S *
00610    *************************/    
00611 
00612 
00613   MSG("AtNuDisplayModule",Msg::kDebug) << " *** SHIELD DISPLAY *** " << endl;
00614 
00615 
00616 
00617   /************************************
00618    * X - Y    C O - O R D I N A T E S *
00619    ************************************/
00620 
00621   MSG("AtNuDisplayModule",Msg::kDebug) << " *** X-Y DISPLAY *** " << endl;
00622 
00623   if(strplist){
00624  
00625     Int_t j,k,ktmp;
00626     
00627     Int_t vuw,sm,pln;
00628     Double_t upos = 0., vpos = 0., tpos = 0., opos = 0., xpos = 0., ypos = 0.;
00629     Double_t totq,totqo,chg;
00630     Int_t n=0,N=0;
00631 
00632     TIter stritr(strplist->GetDaughterIterator());
00633     while(CandStripHandle* str = dynamic_cast<CandStripHandle*>(stritr())){
00634       pln = str->GetPlane(); chg=str->GetCharge();
00635       if(pln>0 && pln<500 && chg>2.0){
00636         fStrpList[pln].Add(str); 
00637         N++;
00638       }
00639     }
00640 
00641     if(N>0){
00642       Double_t* X = new Double_t[N];
00643       Double_t* Y = new Double_t[N];
00644       Double_t* Q = new Double_t[N];
00645 
00646       n=0;
00647       for(j=0;j<500;j++){
00648         for(k=0;k<1+fStrpList[j].GetLast();k++){
00649           CandStripHandle* strp = (CandStripHandle*)(fStrpList[j].At(k));
00650           vuw=-1; sm=-1; pln=strp->GetPlane(); 
00651           tpos=strp->GetTPos(); opos=0.0;       
00652           if(strp->GetPlaneView()==PlaneView::kU) vuw=0;
00653           if(strp->GetPlaneView()==PlaneView::kV) vuw=1;
00654           if(pln>0 && pln<249) sm=1; if(pln>249 && pln<498) sm=2;
00655           if(sm>-1 && vuw>-1){                   
00656             totqo=0.0; totq=0.0;
00657             if((j>1&&j<249)||(j>250&&j<498)){
00658               for(ktmp=0;ktmp<1+fStrpList[j-1].GetLast();ktmp++){
00659                 CandStripHandle* tmpstrp = (CandStripHandle*)(fStrpList[j-1].At(ktmp));  
00660                 totqo+=tmpstrp->GetCharge()*tmpstrp->GetTPos();
00661                 totq+=tmpstrp->GetCharge();
00662               } 
00663             }        
00664             if((j>0&&j<248)||(j>249&&j<497)){
00665               for(ktmp=0;ktmp<1+fStrpList[j+1].GetLast();ktmp++){
00666                 CandStripHandle* tmpstrp = (CandStripHandle*)(fStrpList[j+1].At(ktmp));  
00667                 totqo+=tmpstrp->GetCharge()*tmpstrp->GetTPos();
00668                 totq+=tmpstrp->GetCharge();
00669               }
00670             }
00671             if(totq>0.0){ opos=totqo/totq; } else{ opos=0.0; }
00672 
00673             if(vuw==0){ upos=tpos; vpos=opos; } 
00674             if(vuw==1){ upos=opos; vpos=tpos; }
00675             xpos=0.7071*(upos-vpos); ypos=0.7071*(upos+vpos); 
00676 
00677             if(n<N){
00678               X[n]=xpos; Y[n]=ypos; Q[n]=strp->GetCharge(); n++;
00679             }
00680           }
00681         }
00682       }
00683     
00684       if(n>0){
00685 
00686         Int_t N1=0,N2=0,N3=0;
00687         for(j=0;j<N;j++){
00688           if(Q[j]>0.0&&Q[j]<5.0) N1++; 
00689           if(Q[j]>=5.0&&Q[j]<50.0) N2++; 
00690           if(Q[j]>=50.0) N3++;
00691         }
00692 
00693         if(N1>0){
00694           n=0;
00695           Double_t* tmpX = new Double_t[N1];
00696           Double_t* tmpY = new Double_t[N1];
00697           for(j=0;j<N;j++){
00698             if(Q[j]>0.0&&Q[j]<5.0 && n<N1){
00699               tmpX[n]=X[j]; tmpY[n]=Y[j]; n++;
00700             }
00701           }
00702           if(n>0){
00703             strpXY1 = new TPolyMarker(n,tmpX,tmpY);
00704             strpXY1->SetMarkerColor(6);
00705             strpXY1->SetMarkerStyle(4);
00706             strpXY1->SetMarkerSize(1.5);
00707           }
00708           delete [] tmpX; 
00709           delete [] tmpY;
00710         }
00711 
00712         if(N2>0){
00713           n=0;
00714           Double_t* tmpX = new Double_t[N2];
00715           Double_t* tmpY = new Double_t[N2];
00716           for(j=0;j<N;j++){
00717             if(Q[j]>=5.0&&Q[j]<50.0 && n<N2){
00718               tmpX[n]=X[j]; tmpY[n]=Y[j]; n++;
00719             }
00720           }
00721           if(n>0){
00722             strpXY2 = new TPolyMarker(n,tmpX,tmpY);
00723             strpXY2->SetMarkerColor(8);
00724             strpXY2->SetMarkerStyle(20);
00725             strpXY2->SetMarkerSize(1.5);
00726           }
00727           delete [] tmpX; 
00728           delete [] tmpY;          
00729         }
00730 
00731         if(N3>0){
00732           n=0;
00733           Double_t* tmpX = new Double_t[N3];
00734           Double_t* tmpY = new Double_t[N3];
00735           for(j=0;j<N;j++){
00736             if(Q[j]>=50.0 && n<N3){
00737               tmpX[n]=X[j]; tmpY[n]=Y[j]; n++;
00738             }
00739           }
00740           if(n>0){
00741             strpXY3 = new TPolyMarker(n,tmpX,tmpY);
00742             strpXY3->SetMarkerColor(2);
00743             strpXY3->SetMarkerStyle(20);
00744             strpXY3->SetMarkerSize(1.5);
00745           }
00746           delete [] tmpX; 
00747           delete [] tmpY;          
00748         }
00749 
00750       }
00751 
00752       delete [] X; 
00753       delete [] Y;
00754       delete [] Q;
00755     }
00756   
00757     for(j=0;j<500;j++){
00758       fStrpList[j].Clear();
00759     }
00760 
00761   }
00762 
00763   /*******************************
00764    * C H A R G E   D I S P L A Y *
00765    *******************************/
00766 
00767   MSG("AtNuDisplayModule",Msg::kDebug) << " *** CHARGE DISPLAY *** " << endl;
00768 
00769   if(strplist){
00770  
00771     Int_t n1,n2,pln,npln;
00772     Int_t begpln=-1,endpln=-1;
00773     Double_t chg;
00774 
00775     TIter stritr(strplist->GetDaughterIterator());
00776     while(CandStripHandle* str = dynamic_cast<CandStripHandle*>(stritr())){
00777       pln = str->GetPlane(); chg=str->GetCharge();
00778       if(pln>0 && pln<500){
00779         fStrpList[pln].Add(str); 
00780       }
00781       if(chg>6.0){
00782         if(begpln<0||pln<begpln) begpln=pln; if(endpln<0||pln>endpln) endpln=pln;
00783       }
00784     }
00785 
00786     if(begpln>0 && endpln>0){
00787       npln=1+endpln-begpln;
00788       Double_t* Qarray = new Double_t[npln];
00789 
00790       for(n1=0;n1<npln;n1++){ 
00791         pln = begpln+n1;
00792         Qarray[n1]=0.0;
00793         for(n2=0;n2<1+fStrpList[pln].GetLast();n2++){
00794           CandStripHandle* str = (CandStripHandle*)(fStrpList[pln].At(n2));
00795           Qarray[n1]+=str->GetCharge();
00796         }
00797       }
00798 
00799       Qhist = new TH1D("Qhist","Qhist",npln,begpln-0.5,endpln+0.5);
00800       for(n1=0;n1<npln;n1++){
00801         Qhist->SetBinContent(n1+1,Qarray[n1]);
00802       }
00803       Qhist->SetLineColor(9);
00804       Qhist->SetLineWidth(3);
00805       Qhist->SetTitle("Q vs Z");
00806 
00807       delete [] Qarray;
00808     }
00809 
00810     for(n1=0;n1<500;n1++){
00811       fStrpList[n1].Clear();
00812     }
00813 
00814   }
00815 
00816 
00817   /*******************************
00818    * T I M I N G   D I S P L A Y *
00819    *******************************/
00820 
00821   MSG("AtNuDisplayModule",Msg::kDebug) << " *** TIMING DISPLAY *** " << endl;
00822 
00823   // Get Candidate Track List
00824   CandTrackAtNuListHandle* trklist1 = dynamic_cast<CandTrackAtNuListHandle*>(candrec->FindCandHandle("CandTrackAtNuListHandle"));
00825 
00826   if(trklist1){
00827     Int_t vuw;
00828     Double_t dir,range,offset;
00829     Int_t ctru,ctrv,Nctru,Nctrv;
00830     Double_t dCT,CTmin,CTmax,Smin,Smax;
00831 
00832     TIter trkitr(trklist1->GetDaughterIterator());
00833     CandTrackAtNuHandle* trk = dynamic_cast<CandTrackAtNuHandle*>(trkitr());
00834     if(trk){
00835 
00836       bpln=-1; epln=-1;
00837 
00838       if(trk->GetEndPlane()-trk->GetBegPlane()>0){
00839         bpln=trk->GetBegPlane(); epln=trk->GetEndPlane();
00840       }  
00841 
00842       if(trk->GetEndPlane()-trk->GetBegPlane()<0){
00843         epln=trk->GetBegPlane(); bpln=trk->GetEndPlane();
00844       } 
00845   
00846       if(bpln>0 && epln>0){
00847         npln = 1+epln-bpln;
00848         dir = 3.0e8*trk->GetTimeSlope();
00849         offset = 3.0e8*trk->GetTimeOffset();
00850         range = 0.0;
00851 
00852         for( pln=bpln;pln<epln+1;pln++){
00853           if(trk->GetdS(pln)>range){
00854             range=trk->GetdS(pln);
00855           }
00856         }
00857 
00858         Int_t* plnvuw = new Int_t[npln];
00859         Double_t* dS = new Double_t[npln];
00860         Double_t* CTm = new Double_t[npln];
00861         Double_t* CTp = new Double_t[npln];
00862         Double_t* Qm = new Double_t[npln];
00863         Double_t* Qp = new Double_t[npln];
00864         for(i=0;i<npln;i++){  
00865           plnvuw[i]=-1;
00866           dS[i]=0.0; CTm[i]=0.0; CTp[i]=0.0; Qm[i]=0.0; Qp[i]=0.0;
00867         }
00868 
00869         TIter stritr(trk->GetDaughterIterator());
00870         while(CandStripHandle* strip = (CandStripHandle*)(stritr())){
00871           pln=strip->GetPlane()-bpln; vuw=-1;
00872           if(strip->GetPlaneView()==PlaneView::kU) vuw=0; 
00873           if(strip->GetPlaneView()==PlaneView::kV) vuw=1;
00874           if( vuw>-1 ){ 
00875             plnvuw[pln]=vuw;
00876             if(dir>=0) dS[pln]=trk->GetdS(bpln+pln); else dS[pln]=range-trk->GetdS(bpln+pln);
00877             TIter digitr(strip->GetDaughterIterator());
00878             while(CandDigitHandle* digit = dynamic_cast<CandDigitHandle*>(digitr())){
00879               if(digit->GetPlexSEIdAltL().GetEnd()==StripEnd::kPositive){
00880                 Qp[pln]=strip->GetCharge(StripEnd::kPositive);
00881                 CTp[pln]=3.0e8*trk->GetT(bpln+pln,StripEnd::kPositive);
00882               }
00883               if(digit->GetPlexSEIdAltL().GetEnd()==StripEnd::kNegative){
00884                 Qm[pln]=strip->GetCharge(StripEnd::kNegative);
00885                 CTm[pln]=3.0e8*trk->GetT(bpln+pln,StripEnd::kNegative);
00886               }
00887             }
00888           }
00889         }
00890 
00891         // Draw
00892         ctru=0; ctrv=0;
00893         for(pln=0;pln<npln;pln++){
00894           if(plnvuw[pln]>-1){
00895             if(plnvuw[pln]==0){ if(Qm[pln]>0.0) ctru++; if(Qp[pln]>0.0) ctru++; }
00896             if(plnvuw[pln]==1){ if(Qm[pln]>0.0) ctrv++; if(Qp[pln]>0.0) ctrv++; }
00897           }
00898         }
00899         Nctru=ctru; Nctrv=ctrv;
00900 
00901         if(Nctru>0&&Nctrv>0){
00902           Double_t* Ux = new Double_t[Nctru];
00903           Double_t* Uy = new Double_t[Nctru];
00904           Double_t* Vx = new Double_t[Nctrv];
00905           Double_t* Vy = new Double_t[Nctrv];
00906 
00907           if( dir>=0.0 ){
00908             Smin=0.0; Smax=range;
00909             CTmin=offset-0.5; CTmax=offset+range+0.5;
00910           }
00911           else{
00912             Smin=0.0; Smax=range;
00913             CTmin=offset-range-0.5; CTmax=offset+0.5;
00914           }
00915 
00916           ctru=0; ctrv=0;
00917           for(pln=0;pln<npln;pln++){
00918             if(plnvuw[pln]>-1){
00919               if(plnvuw[pln]==0){
00920                 if(Qm[pln]>0.0 && ctru<Nctru){ 
00921                   Ux[ctru]=dS[pln]; Uy[ctru]=CTm[pln]; ctru++; 
00922                 }
00923                 if(Qp[pln]>0.0 && ctru<Nctru){ 
00924                   Ux[ctru]=dS[pln]; Uy[ctru]=CTp[pln]; ctru++; 
00925                 }
00926               }
00927               if(plnvuw[pln]==1){
00928                 if(Qm[pln]>0.0 && ctrv<Nctrv){ 
00929                   Vx[ctrv]=dS[pln]; Vy[ctrv]=CTm[pln]; ctrv++; 
00930                 }
00931                 if(Qp[pln]>0.0 && ctrv<Nctrv){ 
00932                   Vx[ctrv]=dS[pln]; Vy[ctrv]=CTp[pln]; ctrv++; 
00933                 }
00934               }
00935             }
00936           }
00937 
00938 
00939           dCT = (CTmax-CTmin)-(Smax-Smin);
00940           if(dCT>0.0){
00941             Smin=Smin-0.5*dCT; Smax=Smax+0.5*dCT;
00942           }
00943           if(dCT<0.0){
00944             CTmin=CTmin+0.5*dCT; CTmax=CTmax-0.5*dCT;
00945           }
00946 
00947           plotu = new TPolyMarker(Nctru,Ux,Uy);
00948           plotu->SetMarkerStyle(20); plotu->SetMarkerColor(9); plotu->SetMarkerSize(1.5);
00949           plotv = new TPolyMarker(Nctrv,Vx,Vy);
00950           plotv->SetMarkerStyle(20); plotv->SetMarkerColor(8); plotv->SetMarkerSize(1.5);
00951 
00952           fct = new TF1("fp","[0]+[1]*x",Smin,Smax); 
00953           fct->SetParameter(0,offset); fct->SetParameter(1,dir);
00954           
00955           fTimeDisplay->GetXaxis()->SetLimits(Smin,Smax);
00956           fTimeDisplay->GetYaxis()->SetLimits(CTmin,CTmax);
00957       
00958           leg1 = new TLegend(0.75,0.75,0.95,0.95);
00959           leg1->AddEntry(plotu,"U","p");
00960           leg1->AddEntry(plotv,"V","p");
00961           leg1->AddEntry(fct,"best fit","l");
00962 
00963           delete [] Ux;
00964           delete [] Uy;
00965           delete [] Vx;
00966           delete [] Vy;
00967 
00968           fTimingDisplay=1;
00969         }
00970         
00971         delete [] dS; 
00972         delete [] CTm; 
00973         delete [] CTp; 
00974         delete [] Qm; 
00975         delete [] Qp;  
00976         delete [] plnvuw; 
00977 
00978       }
00979     }
00980   }
00981 
00982 
00983  
00984   /*************************
00985    * D R A W   C A N V A S *
00986    *************************/
00987 
00988   MSG("AtNuDisplayModule",Msg::kInfo) << " *** DRAW CANVAS *** " << endl;
00989 
00990   if(fSpaceDisplay){
00991     fUZpad->cd(); fUviewDis1->Draw();
00992     if(uSTR) uSTR->Draw(); 
00993     if(uXTALK) uXTALK->Draw(); 
00994     if(uSHW) uSHW->Draw(); 
00995     if(uTRK) uTRK->Draw();
00996     if(leg) leg->Draw();
00997     fVZpad->cd(); fVviewDis1->Draw();
00998     if(vSTR) vSTR->Draw(); 
00999     if(vXTALK) vXTALK->Draw(); 
01000     if(vSHW) vSHW->Draw(); 
01001     if(vTRK) vTRK->Draw();
01002   }
01003 
01004   fTitlePad->cd();
01005   fTitlePad->Clear();
01006   TString run_string(" Run "); run_string+=Run;
01007   TString snarl_string(" Snarl "); snarl_string+=Snarl;
01008   TLatex title;
01009   title.SetTextSize(0.2);
01010   title.SetTextAlign(22);
01011   title.DrawLatex(0.5,0.66,run_string.Data());
01012   title.DrawLatex(0.5,0.33,snarl_string.Data());
01013 
01014   fXYpad->cd();
01015   fXYdisplay->Draw();
01016   fDetOutline->Draw();
01017   fDetOutlineC->Draw();
01018   //fVeto1->Draw(); 
01019   //fVeto2->Draw(); 
01020   //fVeto3->Draw(); 
01021   //fVeto4->Draw(); 
01022   //fVeto5->Draw();
01023   if(SHLD1) SHLD1->Draw();
01024   if(SHLD2) SHLD2->Draw();
01025   if(SHLD3) SHLD3->Draw();
01026   if(strpXY1) strpXY1->Draw();
01027   if(strpXY2) strpXY2->Draw();
01028   if(strpXY3) strpXY3->Draw();
01029 
01030   fQpad->cd();
01031   if(Qhist) Qhist->Draw();
01032 
01033   if(fTimingDisplay){
01034     fTpad->cd(); fTimeDisplay->Draw();
01035     if(plotu) plotu->Draw();
01036     if(plotv) plotv->Draw();
01037     if(fct) fct->Draw("same");
01038     if(leg1) leg1->Draw();
01039   }
01040 
01041   fCanvas->Update();
01042 
01043   if(fSave){
01044     cout << " *** WOULD YOU LIKE TO SAVE THIS CANVAS (y/n) ? *** " << endl;
01045     char save[10];
01046     gets(save);
01047     if(save[0]=='y'){
01048       TString outfile("atnudisplay");
01049       outfile.Append(".");
01050       outfile+=Run;
01051       outfile.Append(".");
01052       outfile+=Snarl;
01053       outfile.Append(".gif");
01054       fCanvas->SaveAs(outfile.Data());  
01055       cout << "   ... SAVED CANVAS AS : " << outfile.Data() << endl;  
01056     }
01057   }
01058 
01059   if(uSTR) delete uSTR; 
01060   if(uXTALK) delete uXTALK;
01061   if(uSHW) delete uSHW; 
01062   if(uTRK) delete uTRK;
01063   if(leg) delete leg;  
01064 
01065   if(vSTR) delete vSTR; 
01066   if(vXTALK) delete vXTALK;
01067   if(vSHW) delete vSHW; 
01068   if(vTRK) delete vTRK;
01069 
01070   if(SHLD1) delete SHLD1;
01071   if(SHLD2) delete SHLD2;
01072   if(SHLD3) delete SHLD3;
01073 
01074   if(strpXY1) delete strpXY1;
01075   if(strpXY2) delete strpXY2;
01076   if(strpXY3) delete strpXY3;
01077 
01078   if(Qhist) delete Qhist;
01079 
01080   if(plotu) delete plotu;
01081   if(plotv) delete plotv;
01082   if(fct) delete fct;
01083   if(leg1) delete leg1;
01084 
01085   
01086   return result;
01087 
01088 }
01089 
01090 const Registry& AtNuDisplayModule::DefaultConfig() const
01091 {
01092   MSG("AtNuDisplayModule",Msg::kInfo) << " *** AtNuDisplayModule::DefaultConfig() *** " << endl;
01093   static Registry r;
01094   r.SetName("AtNuDisplayModule.config.default");
01095   r.UnLockValues();
01096   r.Set("ListInStrp",fListInStrp.Data());
01097   r.Set("ListInTrk",fListInTrk.Data());
01098   r.Set("ListInShw",fListInShw.Data());
01099   r.LockValues();
01100   return r;
01101 }
01102 
01103 void AtNuDisplayModule::Config(const Registry& r)
01104 {
01105   MSG("AtNuDisplayModule",Msg::kInfo) << " *** AtNuDisplayModule::Config() *** " << endl;
01106   const char* tmpchar = 0;
01107   if(r.Get("ListInStrp",tmpchar)) fListInStrp = tmpchar;
01108   if(r.Get("ListInTrk",tmpchar)) fListInTrk = tmpchar;
01109   if(r.Get("ListInShw",tmpchar)) fListInShw = tmpchar;
01110   MSG("AtNuDisplayModule", Msg::kInfo) << "   ... input: " << endl
01111                                        << "         Strip List = " << fListInStrp.Data() << endl
01112                                        << "         Track List = " << fListInTrk.Data() << endl
01113                                        << "         Shower List = " << fListInShw.Data() << endl;
01114   return;
01115 }
01116 
01117 void AtNuDisplayModule::HandleCommand(JobCommand *command)
01118 {
01119   TString cmd = command->PopCmd();
01120   if(cmd=="Set"){
01121     TString opt = command->PopOpt();
01122   
01123   }
01124 }
01125 
01126 void AtNuDisplayModule::EndJob()
01127 {
01128 
01129 }

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