X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONChamberTrigger.cxx;h=2160d89e5cda64a99c230dd6fa68033854c945ec;hb=92c1978f3efc471de30f7dbe153c687cfb36c1f0;hp=6eff4f5489c2dd11fb643dcf716f4e6f5837bafa;hpb=a30a000fda6ccf10620ecf96d42273b8ab83723b;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONChamberTrigger.cxx b/MUON/AliMUONChamberTrigger.cxx index 6eff4f5489c..2160d89e5cd 100644 --- a/MUON/AliMUONChamberTrigger.cxx +++ b/MUON/AliMUONChamberTrigger.cxx @@ -13,64 +13,72 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.5 2000/06/29 12:34:09 morsch -AliMUONSegmentation class has been made independent of AliMUONChamber. This makes -it usable with any other geometry class. The link to the object to which it belongs is -established via an index. This assumes that there exists a global geometry manager -from which the pointer to the parent object can be obtained (in our case gAlice). - -Revision 1.4 2000/06/29 06:52:02 pcrochet -pow changed to TMath::Power - -Revision 1.3 2000/06/28 15:16:35 morsch -(1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there) -to allow development of slat-muon chamber simulation and reconstruction code in the MUON -framework. The changes should have no side effects (mostly dummy arguments). -(2) Hit disintegration uses 3-dim hit coordinates to allow simulation -of chambers with overlapping modules (MakePadHits, Disintegration). - -Revision 1.2 2000/06/15 07:58:48 morsch -Code from MUON-dev joined - -Revision 1.1.2.3 2000/06/09 21:27:35 morsch -Most coding rule violations corrected. - -Revision 1.1.2.2 2000/04/26 12:28:25 morsch -- flag pad hits with condition on ToF (CP) -- Tof included in the method DisIntegration (CP) - -Revision 1.1.2.1 2000/02/17 14:30:54 morsch -Draft version - -*/ +/* $Id$ */ #include "AliMUONChamberTrigger.h" -#include "AliMUONSegmentationTrigger.h" #include "AliMUONResponseTrigger.h" -#include -#include -#include +#include "AliMUONHit.h" +#include "AliMUON.h" +#include "AliMUONSegmentation.h" +#include "AliMUONGeometrySegmentation.h" +#include "AliMUONGeometryTransformer.h" +#include "AliLog.h" ClassImp(AliMUONChamberTrigger) +/// +/// \class AliMUONChamberTrigger +/// +/// Implementation of AliMUONChamber for the trigger +/// +/// This class is to be deprecated. +/// + //------------------------------------------- - AliMUONChamberTrigger::AliMUONChamberTrigger() +AliMUONChamberTrigger::AliMUONChamberTrigger() + : AliMUONChamber(), + fkGeomTransformer(0) { // Default constructor } +//------------------------------------------- + +AliMUONChamberTrigger::AliMUONChamberTrigger(const AliMUONChamberTrigger& right) + : AliMUONChamber(right) +{ +/// Protected copy constructor (not implemented) + + AliFatal("Copy constructor not provided."); +} -AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id) : AliMUONChamber(id) +//------------------------------------------- + +AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id, + const AliMUONGeometryTransformer* kGeometryTransformer) + : AliMUONChamber(id), + fkGeomTransformer(kGeometryTransformer) { // Constructor using chamber id } //------------------------------------------- -void AliMUONChamberTrigger::DisIntegration(Float_t eloss, Float_t tof, - Float_t xhit, Float_t yhit, Float_t zhit, +AliMUONChamberTrigger& +AliMUONChamberTrigger::operator=(const AliMUONChamberTrigger& right) +{ +/// Protected assignement operator (not implemented) + + // check assignement to self + if (this == &right) return *this; + + AliFatal("Assignement operator not provided."); + + return *this; +} + +//------------------------------------------- +void AliMUONChamberTrigger::DisIntegration(AliMUONHit* hit, Int_t& nnew, Float_t newclust[6][500]) { @@ -78,6 +86,13 @@ void AliMUONChamberTrigger::DisIntegration(Float_t eloss, Float_t tof, // Generates pad hits (simulated cluster) // using the segmentation and the response model + + Float_t tof = hit->Age(); + Float_t xhit = hit->X(); + Float_t yhit = hit->Y(); + Float_t zhit = hit->Z(); + Int_t id = hit->DetElemId(); + Int_t twentyNano; if (tof<75*TMath::Power(10,-9)) { twentyNano=1; @@ -85,25 +100,34 @@ void AliMUONChamberTrigger::DisIntegration(Float_t eloss, Float_t tof, twentyNano=100; } - // cout << " time = " << tof << " , " << twentyNano << "\n"; - Float_t qp; nnew=0; - for (Int_t i=1; i<=fnsec; i++) { - AliSegmentation * segmentation= - (AliSegmentation*) (*fSegmentation)[i-1]; + for (Int_t i = 1; i <= 2; i++) { + + AliMUONGeometrySegmentation* segmentation= + fMUON->GetSegmentation()->GetModuleSegmentation(fId, i-1); + // Find the module & strip Id. which has fired - Int_t ix,iy; - - segmentation->GetPadI(xhit,yhit,0,ix,iy); - segmentation->SetPad(ix,iy); - + Int_t ix(-1); + Int_t iy(-1); + segmentation->GetPadI(id,xhit,yhit,0,ix,iy); // treatment of GEANT hits w/o corresponding strip (due to the fact that -// the 2 geometries are computed in a very slightly different way) - if (ix==0&&iy==0) { - cout << " AliMUONChamberTrigger hit w/o strip " << xhit << " , " << yhit << "\n"; - } else { +// geometry & segmentation are computed in a very slightly different way) + if ( ix<0 || iy<0 ) + { + Float_t lx,ly,lz; + fkGeomTransformer->Global2Local(id,xhit,yhit,0,lx,ly,lz); + AliWarning(Form("AliMUONChamberTrigger hit w/o strip %i-%d %e %e " + "local %e %e %e ix,iy=%d,%d\n",id,i-1,xhit,yhit,lx,ly,lz,ix,iy)); + } else + { + segmentation->SetPad(id,ix,iy); + if (xhit<0) ix = -ix; + // printf(" fId id fnsec xhit yhit zhit ix iy %i %i %i %f %f %f %i %i \n",fId,i,id,xhit,yhit,zhit,ix,iy); + // if (ix < 0 || ix > 10000) return; + // if (iy < 0 || iy > 10000) return; + // --- store signal information for this strip newclust[0][nnew]=1.; // total charge newclust[1][nnew]=ix; // ix-position of pad @@ -112,35 +136,45 @@ void AliMUONChamberTrigger::DisIntegration(Float_t eloss, Float_t tof, newclust[4][nnew]=segmentation->ISector(); // sector id newclust[5][nnew]=(Float_t) i; // counter nnew++; - // set hits - segmentation->SetHit(xhit,yhit,zhit); - // get the list of nearest neighbours - Int_t nList, xList[2], yList[2]; - segmentation->Neighbours(ix,iy,&nList,xList,yList); - for (Int_t j=0; jGetPadC(xList[j],yList[j],x,y,z); - // set pad (fx fy & fix fiy are the current pad coord. & Id.) - segmentation->SetPad(xList[j],yList[j]); - // get the chamber (i.e. current strip) response - qp=fResponse->IntXY(segmentation); - - if (qp > 0.5) { - // --- store signal information for neighbours - newclust[0][nnew]=qp; // total charge - newclust[1][nnew]=segmentation->Ix(); // ix-position of pad - newclust[2][nnew]=segmentation->Iy(); // iy-position of pad - newclust[3][nnew]=twentyNano; // time of flight - newclust[4][nnew]=segmentation->ISector(); // sector id - newclust[5][nnew]=(Float_t) i; // counter - nnew++; - } // qp > 0.5 - } // loop on neighbour - } // endif hit w/o strip - } // loop over planes + // cluster-size if AliMUONResponseTriggerV1, nothing if AliMUONResponseTrigger + if (((AliMUONResponseTrigger*) fResponse)->SetGenerCluster()) { + + // set hits + segmentation->SetHit(id,xhit,yhit,zhit); + // get the list of nearest neighbours + Int_t nList, xList[10], yList[10]; + segmentation->Neighbours(id,ix,iy,&nList,xList,yList); + + qp = 0; + for (Int_t j=0; jGetPadC(id,xList[j],yList[j],x,y,z); + // set pad (fx fy & fix fiy are the current pad coord. & Id.) + segmentation->SetPad(id,xList[j],yList[j]); + // get the chamber (i.e. current strip) response + qp=fResponse->IntXY(id,segmentation); + + if (qp > 0.5) { + // --- store signal information for neighbours + newclust[0][nnew]=qp; // total charge + newclust[1][nnew]=segmentation->Ix(); // ix-pos. of pad + newclust[2][nnew]=segmentation->Iy(); // iy-pos. of pad + newclust[3][nnew]=twentyNano; // time of flight + newclust[4][nnew]=segmentation->ISector(); // sector id + newclust[5][nnew]=(Float_t) i; // counter + nnew++; + } // qp > 0.5 + } // built-up cluster-size + } // existing neighbour + } // loop over neighbours + } // endif hit w/o strip + } // loop over planes + } // if AliMUONResponseTriggerV1 } @@ -148,5 +182,3 @@ void AliMUONChamberTrigger::DisIntegration(Float_t eloss, Float_t tof, - -