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

Emc2DCrystal Class Reference

#include <Emc2DCrystal.h>

List of all members.

Public Member Functions

virtual void AddInfo (TString info)
virtual void AddInfo (TString info)
virtual void ClearInfo ()
virtual void ClearInfo ()
virtual void CloseInfo ()
virtual void CloseInfo ()
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
virtual void Draw (Option_t *option="")
virtual void Draw (Option_t *option="")
 Emc2DCrystal (const char *name, const char *title, Int_t N, Double_t *P, Int_t part, Int_t theta)
 Emc2DCrystal ()
 Emc2DCrystal (const char *name, const char *title, Int_t N, Double_t *P, Int_t part, Int_t theta)
 Emc2DCrystal ()
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
Double_t GetAngle (Double_t x, Double_t y)
Double_t GetAngle (Double_t x, Double_t y)
virtual Double_t GetCharge ()
virtual Double_t GetCharge ()
virtual char * GetObjectInfo (Int_t px, Int_t py) const
virtual char * GetObjectInfo (Int_t px, Int_t py) const
virtual Int_t GetPart ()
virtual Int_t GetPart ()
virtual Int_t GetTheta ()
virtual Int_t GetTheta ()
virtual Double_t GetTime ()
virtual Double_t GetTime ()
virtual bool HasZRSection ()
virtual bool HasZRSection ()
virtual bool IsFired ()
virtual bool IsFired ()
virtual bool IsHighlighted ()
virtual bool IsHighlighted ()
virtual bool IsSideVisible ()
virtual bool IsSideVisible ()
virtual bool IsXYVisible ()
virtual bool IsXYVisible ()
virtual void Paint (Option_t *option="")
virtual void Paint (Option_t *option="")
virtual void ProjectECToSide (Double_t *p1, Double_t *newP)
virtual void ProjectECToSide (Double_t *p1, Double_t *newP)
Double_t Range360 (Double_t input)
Double_t Range360 (Double_t input)
virtual void ResetTimeCharge ()
virtual void ResetTimeCharge ()
virtual void SetCharge (Double_t charge)
virtual void SetCharge (Double_t charge)
virtual void SetFired (bool status=true)
virtual void SetFired (bool status=true)
virtual void SetHighlighted (bool status=true)
virtual void SetHighlighted (bool status=true)
virtual void SetStyle ()
virtual void SetStyle ()
virtual void SetTime (Double_t time)
virtual void SetTime (Double_t time)
virtual void SetXYPoint (Double_t *p1, Double_t *p2, Double_t *newP, Double_t z)
virtual void SetXYPoint (Double_t *p1, Double_t *p2, Double_t *newP, Double_t z)
virtual void SetZRPoint (Double_t *p1, Double_t *p2, Double_t *newP, Double_t r)
virtual void SetZRPoint (Double_t *p1, Double_t *p2, Double_t *newP, Double_t r)
 ~Emc2DCrystal ()
 ~Emc2DCrystal ()

Private Attributes

Int_t fcCrystal
Int_t fcCrystalFired
Int_t fcCrystalFiredHL
Int_t fcCrystalHL
Double_t fCharge
BesPolygon2DfCrystalSide
BesPolygon2DfCrystalSide
BesPolygon2DfCrystalSideFired
BesPolygon2DfCrystalSideFired
BesPolygon2DfCrystalXY
BesPolygon2DfCrystalXY
BesPolygon2DfCrystalXYFired
BesPolygon2DfCrystalXYFired
BesPolygon2DfCrystalZR
BesPolygon2DfCrystalZR
BesPolygon2DfCrystalZRFired
BesPolygon2DfCrystalZRFired
bool fFired
bool fHighlighted
std::vector< TString > fInfoCon
std::vector< TString > fInfoCon
Int_t fPart
Double_t fPhiMax
Double_t fPhiMin
Int_t fsCrystal
Int_t fsCrystalFired
Int_t fsCrystalFiredHL
Int_t fsCrystalHL
Int_t fsCrystalTrans
Int_t fTheta
Double_t fTime
BesPaveTextfTip
BesPaveTextfTip
Double_t fZRSectionTolerance [3]
Int_t lcCrystal
Int_t lcCrystalFired
Int_t lcCrystalFiredHL
Int_t lcCrystalHL
Int_t lwCrystal
Int_t lwCrystalFired
Int_t lwCrystalFiredHL
Int_t lwCrystalHL

Static Private Attributes

const Int_t brZRPointR = 990.0
const Int_t ecXYPointZ = 1420.0
const Int_t fChargeMax = 300
const Int_t sideDeltaPhi = 21


Constructor & Destructor Documentation

Emc2DCrystal::Emc2DCrystal  ) 
 

Emc2DCrystal::Emc2DCrystal const char *  name,
const char *  title,
Int_t  N,
Double_t *  P,
Int_t  part,
Int_t  theta
 

00024 {
00025     SetName(name);
00026     SetTitle(title);
00027     fTip = 0;
00028     fHighlighted = false;
00029     fFired = false;
00030     fPart  = part;
00031     fTheta = theta;
00032 
00033     fTime      = 0.0;
00034     fCharge    = 0.0;
00035 
00036     fZRSectionTolerance[1] = 0.1;  // degree
00037     fZRSectionTolerance[2] = fZRSectionTolerance[0] = 1.2;   // degree
00038 
00039     // ------XY------
00040 
00041     Double_t Pxy[3*5]; // 4 side and 5 side shape in Emc End crystal
00042     if (N == 8) {  // 4 side
00043         Int_t iXYSeq[4] = {0,2,6,4};
00044         for (Int_t i = 0; i < 4; i++) {
00045             if (part == 1) {
00046                 for (Int_t j = 0; j < 3; j++) {
00047                     Pxy[3*i+j] = ( P[3*iXYSeq[i]+j] + P[3*(iXYSeq[i]+1)+j] )/2.0;
00048                 }
00049             }
00050             else if (part == 0) {
00051                 SetXYPoint(&P[3*i], &P[3*(i+4)], &Pxy[3*i], ecXYPointZ);
00052                 //for (Int_t j = 0; j < 3; j++) Pxy[3*i+j] = P[3*i+j];
00053             }
00054             else if (part == 2) {
00055                 SetXYPoint(&P[3*i], &P[3*(i+4)], &Pxy[3*i], -ecXYPointZ);
00056                 //for (Int_t j = 0; j < 3; j++) Pxy[3*i+j] = P[3*i+j];
00057             }
00058             //cout << GetName() << endl;
00059             //if (GetName() == TString("EastEcTheta5Phi0")) cout << Pxy[3*i] << " " << Pxy[3*i+1] << " " << Pxy[3*i+2] << endl;
00060         }
00061 
00062         fCrystalXY      = new BesPolygon2D(name, title, 4, &Pxy[0]);
00063         fCrystalXYFired = new BesPolygon2D(name, title, 4, &Pxy[0]);
00064     }
00065     if (N == 16) {  // 5 side
00066         Int_t iXYSeq[5] = {8,9,1,2,3};            //  9 10,1 2
00067         for (Int_t i = 0; i < 5; i++) {           //  8 11,0 3
00068             if (part == 0) {
00069                 SetXYPoint(&P[3*iXYSeq[i]], &P[3*(iXYSeq[i]+4)], &Pxy[3*i], ecXYPointZ);
00070             }
00071             else if (part == 2) {
00072                 SetXYPoint(&P[3*iXYSeq[i]], &P[3*(iXYSeq[i]+4)], &Pxy[3*i], -ecXYPointZ);
00073             }
00074             //for (Int_t j = 0; j < 3; j++) Pxy[3*i+j] = P[3*iXYSeq[i]+j];
00075         }
00076 
00077         fCrystalXY      = new BesPolygon2D(name, title, 5, &Pxy[0]);
00078         fCrystalXYFired = new BesPolygon2D(name, title, 5, &Pxy[0]);
00079     }
00080 
00081     // ------ZR------
00082 
00083     Double_t Pzr[3*4];
00084     Int_t iSeq[8] = {0,3,1,2,5,6,4,7}; // center of 0+3, 1+2, 5+6, 4+7
00085     for (Int_t i = 0; i < 4; i++) {
00086         for (Int_t j = 0; j < 3; j++) {
00087             Pzr[3*i+j] = (P[3*iSeq[2*i]+j] + P[3*iSeq[2*i+1]+j])/2.0;
00088         }
00089         //if (GetName() == TString("EastEcCrystal0")) cout << Pxy[i] << endl;
00090     }
00091 
00092 
00093     fCrystalZR      = new BesPolygon2D(TString(name)+TString("zr"), title, 4, &Pzr[0]);
00094     fCrystalZRFired = new BesPolygon2D(TString(name)+TString("zr"), title, 4, &Pzr[0]);
00095 
00096     if (N == 8) {
00097         if (GetPart() == 1) {
00098             fPhiMin = GetAngle( P[3*0], P[3*0+1] );
00099             fPhiMax = GetAngle( P[3*3], P[3*3+1] );
00100         }
00101         else {
00102             fPhiMin = GetAngle( P[3*3], P[3*3+1] );
00103             fPhiMax = GetAngle( P[3*0], P[3*0+1] );
00104         }
00105     }
00106     else if (N == 16) {
00107         fPhiMin = GetAngle( P[3*3], P[3*3+1] );
00108         fPhiMax = GetAngle( P[3*8], P[3*8+1] );
00109     }
00110 
00111     if (fPhiMin > fPhiMax && fabs(fPhiMax-fPhiMin) < 180.0) { // not cross 0 degree
00112         Double_t phiTemp = fPhiMin;
00113         fPhiMin = fPhiMax;
00114         fPhiMax = phiTemp;
00115     }
00116     //cout << GetName() << " min "<< fPhiMin << " max " << fPhiMax << endl;
00117 
00118     // ------Side------
00119 
00120     Double_t Pside[3*5]; // 4 side and 5 side shape in Emc End crystal
00121     if (N == 8) {  // 4 side
00122         //Int_t iSideSeq[4] = {0,1,2,3};
00123         for (Int_t i = 0; i < 4; i++) {
00124             if (part == 1) {
00125                 SetZRPoint(&P[3*i], &P[3*(i+4)], &Pside[3*i], brZRPointR);
00126             }
00127             else {
00128                 ProjectECToSide(&Pxy[3*i], &Pside[3*i]);
00129             }
00130         }
00131 
00132         fCrystalSide      = new BesPolygon2D(name, title, 4, &Pside[0]);
00133         fCrystalSideFired = new BesPolygon2D(name, title, 4, &Pside[0]);
00134     }
00135     if (N == 16) {  // 5 side
00136         for (Int_t i = 0; i < 5; i++) {
00137             ProjectECToSide(&Pxy[3*i], &Pside[3*i]);
00138         }
00139 
00140         fCrystalSide      = new BesPolygon2D(name, title, 5, &Pside[0]);
00141         fCrystalSideFired = new BesPolygon2D(name, title, 5, &Pside[0]);
00142     }
00143 
00144     // Init
00145 
00146     SetStyle();
00147 
00148     fTip = new BesPaveText(0, 0, 0.45, 0.08);
00149     CloseInfo();
00150 }

Emc2DCrystal::~Emc2DCrystal  ) 
 

00154                             {
00155 
00156     if (fCrystalXY)  delete fCrystalXY;
00157     if (fCrystalZR)  delete fCrystalZR;
00158     if (fCrystalXYFired)  delete fCrystalXYFired;
00159     if (fCrystalZRFired)  delete fCrystalZRFired;
00160 }

Emc2DCrystal::Emc2DCrystal  ) 
 

Emc2DCrystal::Emc2DCrystal const char *  name,
const char *  title,
Int_t  N,
Double_t *  P,
Int_t  part,
Int_t  theta
 

Emc2DCrystal::~Emc2DCrystal  ) 
 


Member Function Documentation

virtual void Emc2DCrystal::AddInfo TString  info  )  [inline, virtual]
 

00035 { fInfoCon.push_back(info); }

virtual void Emc2DCrystal::AddInfo TString  info  )  [inline, virtual]
 

00035 { fInfoCon.push_back(info); }

virtual void Emc2DCrystal::ClearInfo  )  [virtual]
 

void Emc2DCrystal::ClearInfo  )  [virtual]
 

00187 {
00188     fInfoCon.clear();
00189     fTip->DeleteText();
00190 }

virtual void Emc2DCrystal::CloseInfo  )  [virtual]
 

void Emc2DCrystal::CloseInfo  )  [virtual]
 

00193 {
00194     if (fTip) {
00195         fTip->Clear();
00196 
00197         if (fInfoCon.size() == 0) fInfoCon.push_back(GetTitle());
00198         fTip->SetText(fInfoCon);
00199     }
00200     else
00201         cout << "Emc2DCrystal::CloseInfo, not initialized" << endl;
00202 }

virtual Int_t Emc2DCrystal::DistancetoPrimitive Int_t  px,
Int_t  py
[virtual]
 

Int_t Emc2DCrystal::DistancetoPrimitive Int_t  px,
Int_t  py
[virtual]
 

00206                                                           {
00207 
00208     BesView *view = (BesView*)gPad->GetView();
00209     if ( view->GetViewType() & kXYView ) {
00210         if ( fCrystalXY && IsXYVisible() ) {
00211             return fCrystalXY->DistancetoPrimitive(px, py);
00212         }
00213     }
00214     else if ( view->GetViewType() & kZRView && fCrystalZR && fCrystalSide ) {
00215         if (HasZRSection())
00216             return fCrystalZR->DistancetoPrimitive(px, py);
00217         else if ( IsSideVisible() &&
00218                   (view->GetVisEmcSide() || (view->GetVisEmcHitsSide() && IsFired())) )
00219             return fCrystalSide->DistancetoPrimitive(px, py);
00220     }
00221 
00222     return 9999;
00223 }

virtual void Emc2DCrystal::Draw Option_t *  option = ""  )  [virtual]
 

void Emc2DCrystal::Draw Option_t *  option = ""  )  [virtual]
 

00282                                         {
00283     //
00284     // Emc2DCrystal draw function
00285     TString opt = option;
00286     opt.ToUpper();
00287 
00288     AppendPad(option);
00289 }

virtual void Emc2DCrystal::ExecuteEvent Int_t  event,
Int_t  px,
Int_t  py
[virtual]
 

void Emc2DCrystal::ExecuteEvent Int_t  event,
Int_t  px,
Int_t  py
[virtual]
 

00227                                                                {
00228 
00229     //if (fWireType == 2 && fWireBubble[0] ) {
00230     //if (fWireCone->GetLineWidth() > 1) // FIRED
00231     //cout << GetName() << endl;
00232 
00233     BesView *view = (BesView*)gPad->GetView();
00234 
00235     if (gBesCursor->GetType() == kBesHand) {
00236         if (view) view->ExecuteEvent(event, px, py);
00237     }
00238     else if (gBesCursor->GetType() == kBesPick){
00239 
00240         if (gPad) gPad->SetCursor(kPointer);
00241 
00242         switch (event) {
00243 
00244         case kMouseEnter :
00245             this->SetHighlighted(true);
00246 
00247             //if (this->IsFired() || view->GetVisEmcHitsGlobal()) {
00248             Draw();
00249 
00250             fTip->SetPos(px, py);
00251             view->UpdateView(0);
00252 
00253             fTip->Draw("BR,SAME"); // "BR,ARC,SAME"
00254             gPad->Modified();
00255             gPad->Update();
00256             break;
00257 
00258         case kMouseLeave:
00259             if (this->IsHighlighted()) {
00260                 this->SetHighlighted(false);
00261                 //if (view->GetVisEmcHitsGlobal())
00262                 Draw();
00263 
00264                 /*
00265                   if (fTip) {
00266                   delete fTip;
00267                   fTip = 0;
00268                 }
00269                 */
00270 
00271                 view->UpdateView(0);
00272                 gPad->Modified();
00273                 gPad->Update();
00274                 break;
00275             }
00276         }
00277     }
00278 }

Double_t Emc2DCrystal::GetAngle Double_t  x,
Double_t  y
 

Double_t Emc2DCrystal::GetAngle Double_t  x,
Double_t  y
 

00500 {
00501     Double_t angle = TMath::ACos( x/TMath::Sqrt(x*x+y*y) ) * TMath::RadToDeg();
00502     if ( y<0.0 ) angle *= -1;
00503     angle = Range360(angle);
00504 
00505     return angle;
00506 }

virtual Double_t Emc2DCrystal::GetCharge  )  [inline, virtual]
 

00042 { return fCharge; }

virtual Double_t Emc2DCrystal::GetCharge  )  [inline, virtual]
 

00042 { return fCharge; }

virtual char* Emc2DCrystal::GetObjectInfo Int_t  px,
Int_t  py
const [virtual]
 

char * Emc2DCrystal::GetObjectInfo Int_t  px,
Int_t  py
const [virtual]
 

00452                                                           {
00453 
00454     BesView *view = (BesView*)gPad->GetView();
00455     if (view) return view->GetObjectInfo(px, py);
00456     else return TObject::GetObjectInfo(px, py);
00457 }

virtual Int_t Emc2DCrystal::GetPart  )  [inline, virtual]
 

00049 { return fPart; }

virtual Int_t Emc2DCrystal::GetPart  )  [inline, virtual]
 

00049 { return fPart; }

virtual Int_t Emc2DCrystal::GetTheta  )  [inline, virtual]
 

00050 { return fTheta; }

virtual Int_t Emc2DCrystal::GetTheta  )  [inline, virtual]
 

00050 { return fTheta; }

virtual Double_t Emc2DCrystal::GetTime  )  [inline, virtual]
 

00041 { return fTime; }

virtual Double_t Emc2DCrystal::GetTime  )  [inline, virtual]
 

00041 { return fTime; }

virtual bool Emc2DCrystal::HasZRSection  )  [virtual]
 

bool Emc2DCrystal::HasZRSection  )  [virtual]
 

00462 {
00463     bool flag = false;
00464     BesView *view = (BesView*)gPad->GetView();
00465     Double_t viewPhi = view->GetLongitude();
00466     viewPhi = Range360(viewPhi);
00467     //if (GetName() == TString("Layer0Wire0")) cout << "view " << viewPhi << endl;
00468 
00469     Double_t zrPhi = viewPhi-90.0;
00470     zrPhi = Range360(zrPhi);
00471     //if (GetName() == TString("Layer0Wire0")) cout << zrPhi << endl;
00472 
00473     for (Int_t i = 0; i < 2; i++) {
00474         if (i==1) {
00475             zrPhi += 180.0;
00476             zrPhi = Range360(zrPhi);
00477         }
00478 
00479         if (zrPhi >= fPhiMin-fZRSectionTolerance[GetPart()] &&
00480                 zrPhi <= fPhiMax+fZRSectionTolerance[GetPart()]) {
00481             flag = true;
00482             break;
00483         }
00484         else if (fPhiMin > fPhiMax) { // cross 0 degree
00485             //cout << GetName() << " zrPhi " << zrPhi << " min " << fPhiMin << " max " << fPhiMax << endl;
00486             if (zrPhi >= fPhiMin-fZRSectionTolerance[GetPart()] ||
00487                     zrPhi <= fPhiMax+fZRSectionTolerance[GetPart()]) {
00488                 flag = true;
00489                 break;
00490             }
00491         }
00492     }
00493 
00494     return flag;
00495 }

virtual bool Emc2DCrystal::IsFired  )  [inline, virtual]
 

00033 { return fFired; }

virtual bool Emc2DCrystal::IsFired  )  [inline, virtual]
 

00033 { return fFired; }

virtual bool Emc2DCrystal::IsHighlighted  )  [inline, virtual]
 

00032 { return fHighlighted; }

virtual bool Emc2DCrystal::IsHighlighted  )  [inline, virtual]
 

00032 { return fHighlighted; }

virtual bool Emc2DCrystal::IsSideVisible  )  [virtual]
 

bool Emc2DCrystal::IsSideVisible  )  [virtual]
 

00537 {
00538     BesView *view = (BesView*)gPad->GetView();
00539     Double_t viewPhi = view->GetLongitude();
00540     Double_t viewPhiMin = viewPhi - sideDeltaPhi;
00541     Double_t viewPhiMax = viewPhi + sideDeltaPhi;
00542 
00543     viewPhi    = Range360(viewPhi);
00544     viewPhiMin = Range360(viewPhiMin);
00545     viewPhiMax = Range360(viewPhiMax);
00546     //if (GetName() == TString("Layer0Wire0")) cout << "view " << viewPhi << endl;
00547 
00548     if (viewPhiMin < viewPhiMax) { // not cross 0 degree
00549         if (fPhiMax > viewPhiMin && fPhiMax < viewPhiMax) return true;
00550     }
00551     else { // cross 0 degree
00552         if (fPhiMax > viewPhiMin || fPhiMax < viewPhiMax) return true;
00553     }
00554 
00555     return false;
00556 }

virtual bool Emc2DCrystal::IsXYVisible  )  [virtual]
 

bool Emc2DCrystal::IsXYVisible  )  [virtual]
 

00529 {
00530     if ( GetPart() != 1 || GetTheta() == 0 || IsFired() )
00531         return true;
00532     else
00533         return false;
00534 }

virtual void Emc2DCrystal::Paint Option_t *  option = ""  )  [virtual]
 

void Emc2DCrystal::Paint Option_t *  option = ""  )  [virtual]
 

00293                                          {
00294 
00295     TString opt = option;
00296     opt.ToUpper();
00297 
00298     BesView *view = (BesView*)gPad->GetView();
00299     if (view->GetViewType() & kXYView) {
00300 
00301         if (fCrystalXY) {
00302             fCrystalXY->SetLineColor(lcCrystal);
00303             fCrystalXY->SetLineWidth(lwCrystal);
00304             fCrystalXY->SetFillColor(fcCrystal);
00305             fCrystalXY->SetFillStyle(fsCrystal);
00306         }
00307 
00308         if (this->IsFired()) {
00309             if (fCrystalXY) {
00310                 fCrystalXY->SetFillStyle(fsCrystalTrans);
00311             }
00312             if (fCrystalXYFired) {
00313                 fCrystalXYFired->SetLineColor(lcCrystalFired);
00314                 fCrystalXYFired->SetLineWidth(lwCrystalFired);
00315                 fCrystalXYFired->SetFillColor(fcCrystalFired);
00316                 fCrystalXYFired->SetFillStyle(fsCrystalFired);
00317             }
00318         }
00319 
00320         if (this->IsHighlighted()) {
00321             if (fCrystalXY) {
00322                 fCrystalXY->SetLineColor(lcCrystalHL);
00323                 fCrystalXY->SetLineWidth(lwCrystalHL);
00324                 fCrystalXY->SetFillColor(fcCrystalHL);
00325                 fCrystalXY->SetFillStyle(fsCrystalHL);
00326             }
00327             if (fCrystalXYFired) {
00328                 fCrystalXYFired->SetLineColor(lcCrystalFiredHL);
00329                 fCrystalXYFired->SetLineWidth(lwCrystalFiredHL);
00330                 fCrystalXYFired->SetFillColor(fcCrystalFiredHL);
00331                 fCrystalXYFired->SetFillStyle(fsCrystalFiredHL);
00332             }
00333         }
00334 
00335         if ( fCrystalXY && IsXYVisible() ) fCrystalXY->Paint();
00336         if (this->IsFired()) {
00337             if (view->GetVisEmcHitsGlobal() &&
00338                     ( (fPart == 0 && view->GetVisEmcHitsEast())   ||
00339                       (fPart == 1 && view->GetVisEmcHitsBarrel()) ||
00340                       (fPart == 2 && view->GetVisEmcHitsWest()) )) {
00341                 if (fCrystalXYFired) {
00342                     fCrystalXY->Paint();
00343                     //if (this->IsHighlighted()) cout << GetName() << " is highlighted " << endl;
00344                     //cout << "Emc fired Crystal size " << fCharge/fChargeMax << endl;
00345                     fCrystalXYFired->Restore(); // restore default size
00346                     fCrystalXYFired->SetSize(fCharge/fChargeMax);
00347                     fCrystalXYFired->Paint();
00348                 }
00349             }
00350         }
00351     }
00352 
00353     if (view->GetViewType() & kZRView) {
00354         if (HasZRSection()) {
00355             if (this->IsFired()) {
00356                 if (fCrystalZRFired) {
00357                     fCrystalZRFired->SetLineColor(lcCrystalFired);
00358                     fCrystalZRFired->SetLineWidth(lwCrystalFired);
00359                     fCrystalZRFired->SetFillColor(fcCrystalFired);
00360                     fCrystalZRFired->SetFillStyle(fsCrystalFired);
00361                 }
00362             }
00363 
00364             if (fCrystalZR) {
00365                 fCrystalZR->SetLineColor(lcCrystal);
00366                 fCrystalZR->SetLineWidth(lwCrystal);
00367                 fCrystalZR->SetFillColor(fcCrystal);
00368                 fCrystalZR->SetFillStyle(fsCrystal);
00369             }
00370 
00371             if (this->IsHighlighted()) {
00372                 if (fCrystalZR) {
00373                     fCrystalZR->SetLineColor(lcCrystalHL);
00374                     fCrystalZR->SetLineWidth(lwCrystalHL);
00375                     fCrystalZR->SetFillColor(fcCrystalHL);
00376                     fCrystalZR->SetFillStyle(fsCrystalHL);
00377                 }
00378                 if (fCrystalZRFired) {
00379                     fCrystalZRFired->SetLineColor(lcCrystalFiredHL);
00380                     fCrystalZRFired->SetLineWidth(lwCrystalFiredHL);
00381                     fCrystalZRFired->SetFillColor(fcCrystalFiredHL);
00382                     fCrystalZRFired->SetFillStyle(fsCrystalFiredHL);
00383                 }
00384             }
00385 
00386             if ( fCrystalZR ) fCrystalZR->Paint();
00387             if (this->IsFired()) {
00388                 if (view->GetVisEmcHitsGlobal() &&
00389                         ( (fPart == 0 && view->GetVisEmcHitsEast())   ||
00390                           (fPart == 1 && view->GetVisEmcHitsBarrel()) ||
00391                           (fPart == 2 && view->GetVisEmcHitsWest()) )) {
00392                     if (fCrystalZRFired) {
00393                         //cout << "Emc fired Crystal size " << fCharge/fChargeMax << endl;
00394                         fCrystalZRFired->Restore(); // restore default size
00395                         fCrystalZRFired->SetSize(fCharge/fChargeMax);
00396                         fCrystalZRFired->Paint();
00397                     }
00398                 }
00399             }
00400         }
00401 
00402         // side
00403         if (this->IsFired()) {
00404             if (fCrystalSideFired) {
00405                 fCrystalSideFired->SetLineColor(lcCrystalFired);
00406                 fCrystalSideFired->SetLineWidth(lwCrystalFired);
00407                 fCrystalSideFired->SetFillColor(fcCrystalFired);
00408                 fCrystalSideFired->SetFillStyle(fsCrystalFired);
00409             }
00410         }
00411 
00412         if (fCrystalSide) {
00413             fCrystalSide->SetLineColor(lcCrystal);
00414             fCrystalSide->SetLineWidth(lwCrystal);
00415             fCrystalSide->SetFillColor(fcCrystal);
00416             fCrystalSide->SetFillStyle(fsCrystal);
00417         }
00418 
00419         if (this->IsHighlighted()) {
00420             if (fCrystalSide) {
00421                 fCrystalSide->SetLineColor(lcCrystalHL);
00422                 fCrystalSide->SetLineWidth(lwCrystalHL);
00423                 fCrystalSide->SetFillColor(fcCrystalHL);
00424                 fCrystalSide->SetFillStyle(fsCrystalHL);
00425             }
00426             if (fCrystalSideFired) {
00427                 fCrystalSideFired->SetLineColor(lcCrystalFiredHL);
00428                 fCrystalSideFired->SetLineWidth(lwCrystalFiredHL);
00429                 fCrystalSideFired->SetFillColor(fcCrystalFiredHL);
00430                 fCrystalSideFired->SetFillStyle(fsCrystalFiredHL);
00431             }
00432         }
00433 
00434         if ( IsSideVisible() ) {
00435             if ( (view->GetVisEmcSide() || view->GetVisEmcHitsSide() && this->IsFired()) && fCrystalSide ) fCrystalSide->Paint();
00436             if ( this->IsFired() ) {
00437                 if (view->GetVisEmcHitsGlobal() && view->GetVisEmcHitsSide()) {
00438                     if (fCrystalSideFired) {
00439                         //cout << "Emc fired Crystal size " << fCharge/fChargeMax << endl;
00440                         fCrystalSideFired->Restore(); // restore default size
00441                         fCrystalSideFired->SetSize(fCharge/fChargeMax);
00442                         fCrystalSideFired->Paint();
00443                     }
00444                 }
00445             }
00446         }
00447     }
00448 }

virtual void Emc2DCrystal::ProjectECToSide Double_t *  p1,
Double_t *  newP
[virtual]
 

void Emc2DCrystal::ProjectECToSide Double_t *  p1,
Double_t *  newP
[virtual]
 

00582 {
00583     //  ------ R         ---------
00584     //       |     -->        |
00585     //       | r              |
00586 
00587     Double_t r1 = sqrt(p1[0]*p1[0] + p1[1]*p1[1]);
00588     newP[0] = p1[0] * (brZRPointR/r1);
00589     newP[1] = p1[1] * (brZRPointR/r1);
00590 
00591     Double_t drToR = brZRPointR - r1;
00592     newP[2] = fabs(ecXYPointZ + drToR) * (p1[2]/fabs(p1[2]));
00593 
00594 
00595     //if (GetName() == TString("EastEcTheta0Phi0")) {
00596     //cout << p1[0] << " " << p1[1] << " " << p1[2] << endl;
00597     //cout << newP[0] << " " << newP[1] << " " << newP[2] << endl;
00598     //}
00599 
00600 }

Double_t Emc2DCrystal::Range360 Double_t  input  ) 
 

Double_t Emc2DCrystal::Range360 Double_t  input  ) 
 

00511 {
00512     if (input >= 360.0) {
00513         do {
00514             input -= 360.0;
00515         }
00516         while (input >= 360.0);
00517     }
00518     else if (input < 0.0) {
00519         do {
00520             input += 360.0;
00521         }
00522         while (input < 0.0);
00523     }
00524 
00525     return input;
00526 }

virtual void Emc2DCrystal::ResetTimeCharge  )  [inline, virtual]
 

00043 { fTime = 0.0; fCharge = 0.0; }

virtual void Emc2DCrystal::ResetTimeCharge  )  [inline, virtual]
 

00043 { fTime = 0.0; fCharge = 0.0; }

virtual void Emc2DCrystal::SetCharge Double_t  charge  )  [inline, virtual]
 

00040 { fCharge = charge; }

virtual void Emc2DCrystal::SetCharge Double_t  charge  )  [inline, virtual]
 

00040 { fCharge = charge; }

virtual void Emc2DCrystal::SetFired bool  status = true  )  [inline, virtual]
 

00031 { fFired = status; }

virtual void Emc2DCrystal::SetFired bool  status = true  )  [inline, virtual]
 

00031 { fFired = status; }

virtual void Emc2DCrystal::SetHighlighted bool  status = true  )  [inline, virtual]
 

00030 { fHighlighted = status; }

virtual void Emc2DCrystal::SetHighlighted bool  status = true  )  [inline, virtual]
 

00030 { fHighlighted = status; }

virtual void Emc2DCrystal::SetStyle  )  [virtual]
 

void Emc2DCrystal::SetStyle  )  [virtual]
 

00163 {
00164     lcCrystal = 15;
00165     lwCrystal = 1;
00166     fcCrystal = 1005;  // lightBlue
00167     fsCrystal = 1001;
00168     fsCrystalTrans = 4000;
00169 
00170     lcCrystalFired = kRed;
00171     lwCrystalFired = 1;
00172     fcCrystalFired = kRed;
00173     fsCrystalFired = 1001;
00174 
00175     lcCrystalHL = lcCrystal;
00176     lwCrystalHL = 1;
00177     fcCrystalHL = kBlue;
00178     fsCrystalHL = 1001;
00179 
00180     lcCrystalFiredHL = kRed;
00181     lwCrystalFiredHL = 2;
00182     fcCrystalFiredHL = kWhite;
00183     fsCrystalFiredHL = 4000;
00184 }

virtual void Emc2DCrystal::SetTime Double_t  time  )  [inline, virtual]
 

00039 { fTime = time; }

virtual void Emc2DCrystal::SetTime Double_t  time  )  [inline, virtual]
 

00039 { fTime = time; }

virtual void Emc2DCrystal::SetXYPoint Double_t *  p1,
Double_t *  p2,
Double_t *  newP,
Double_t  z
[virtual]
 

void Emc2DCrystal::SetXYPoint Double_t *  p1,
Double_t *  p2,
Double_t *  newP,
Double_t  z
[virtual]
 

00561 {
00562     Double_t ratio = fabs( (z-p1[2]) / (p2[2]-p1[2]) );
00563     for (Int_t i = 0; i < 3; i++) {
00564         newP[i] = p1[i] * (1.0-ratio) + p2[i] * ratio;
00565     }
00566 }

virtual void Emc2DCrystal::SetZRPoint Double_t *  p1,
Double_t *  p2,
Double_t *  newP,
Double_t  r
[virtual]
 

void Emc2DCrystal::SetZRPoint Double_t *  p1,
Double_t *  p2,
Double_t *  newP,
Double_t  r
[virtual]
 

00571 {
00572     Double_t r1 = sqrt(p1[0]*p1[0] + p1[1]*p1[1]);
00573     Double_t r2 = sqrt(p2[0]*p2[0] + p2[1]*p2[1]);
00574 
00575     Double_t ratio = fabs( (r-r1) / (r2-r1) );
00576     for (Int_t i = 0; i < 3; i++) {
00577         newP[i] = p1[i] * (1.0-ratio) + p2[i] * ratio;
00578     }
00579 }


Member Data Documentation

const Int_t Emc2DCrystal::brZRPointR = 990.0 [static, private]
 

const Int_t Emc2DCrystal::ecXYPointZ = 1420.0 [static, private]
 

Int_t Emc2DCrystal::fcCrystal [private]
 

Int_t Emc2DCrystal::fcCrystalFired [private]
 

Int_t Emc2DCrystal::fcCrystalFiredHL [private]
 

Int_t Emc2DCrystal::fcCrystalHL [private]
 

Double_t Emc2DCrystal::fCharge [private]
 

const Int_t Emc2DCrystal::fChargeMax = 300 [static, private]
 

BesPolygon2D* Emc2DCrystal::fCrystalSide [private]
 

BesPolygon2D* Emc2DCrystal::fCrystalSide [private]
 

BesPolygon2D* Emc2DCrystal::fCrystalSideFired [private]
 

BesPolygon2D* Emc2DCrystal::fCrystalSideFired [private]
 

BesPolygon2D* Emc2DCrystal::fCrystalXY [private]
 

BesPolygon2D* Emc2DCrystal::fCrystalXY [private]
 

BesPolygon2D* Emc2DCrystal::fCrystalXYFired [private]
 

BesPolygon2D* Emc2DCrystal::fCrystalXYFired [private]
 

BesPolygon2D* Emc2DCrystal::fCrystalZR [private]
 

BesPolygon2D* Emc2DCrystal::fCrystalZR [private]
 

BesPolygon2D* Emc2DCrystal::fCrystalZRFired [private]
 

BesPolygon2D* Emc2DCrystal::fCrystalZRFired [private]
 

bool Emc2DCrystal::fFired [private]
 

bool Emc2DCrystal::fHighlighted [private]
 

std::vector<TString> Emc2DCrystal::fInfoCon [private]
 

std::vector<TString> Emc2DCrystal::fInfoCon [private]
 

Int_t Emc2DCrystal::fPart [private]
 

Double_t Emc2DCrystal::fPhiMax [private]
 

Double_t Emc2DCrystal::fPhiMin [private]
 

Int_t Emc2DCrystal::fsCrystal [private]
 

Int_t Emc2DCrystal::fsCrystalFired [private]
 

Int_t Emc2DCrystal::fsCrystalFiredHL [private]
 

Int_t Emc2DCrystal::fsCrystalHL [private]
 

Int_t Emc2DCrystal::fsCrystalTrans [private]
 

Int_t Emc2DCrystal::fTheta [private]
 

Double_t Emc2DCrystal::fTime [private]
 

BesPaveText* Emc2DCrystal::fTip [private]
 

BesPaveText* Emc2DCrystal::fTip [private]
 

Double_t Emc2DCrystal::fZRSectionTolerance [private]
 

Int_t Emc2DCrystal::lcCrystal [private]
 

Int_t Emc2DCrystal::lcCrystalFired [private]
 

Int_t Emc2DCrystal::lcCrystalFiredHL [private]
 

Int_t Emc2DCrystal::lcCrystalHL [private]
 

Int_t Emc2DCrystal::lwCrystal [private]
 

Int_t Emc2DCrystal::lwCrystalFired [private]
 

Int_t Emc2DCrystal::lwCrystalFiredHL [private]
 

Int_t Emc2DCrystal::lwCrystalHL [private]
 

const Int_t Emc2DCrystal::sideDeltaPhi = 21 [static, private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:01:02 2011 for BOSS6.5.5 by  doxygen 1.3.9.1