LCOV - code coverage report
Current view: top level - MUON/MUONsim - AliMUONResponseTrigger.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 5 38 13.2 %
Date: 2016-06-14 17:26:59 Functions: 3 9 33.3 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : /* $Id$ */
      17             : 
      18             : 
      19             : //-----------------------------------------------------------------------------
      20             : // Class AliMUONResponseTrigger
      21             : // -------------------------------
      22             : // Implementation 
      23             : // of RPC response
      24             : //-----------------------------------------------------------------------------
      25             : 
      26             : 
      27             : #include "AliMUONResponseTrigger.h"
      28             : #include "AliMUON.h"
      29             : #include "AliMUONDigit.h"
      30             : #include "AliMUONGeometryTransformer.h"
      31             : #include "AliMUONHit.h"
      32             : #include "AliMUONConstants.h"
      33             : 
      34             : #include "AliMpPad.h"
      35             : #include "AliMpCathodType.h"
      36             : #include "AliMpPlaneType.h"
      37             : #include "AliMpSegmentation.h"
      38             : #include "AliMpVSegmentation.h"
      39             : 
      40             : #include "AliRun.h"
      41             : #include "AliLog.h"
      42             : #include "TList.h"
      43             : 
      44             : /// \cond CLASSIMP
      45          16 : ClassImp(AliMUONResponseTrigger)
      46             : /// \endcond
      47             : 
      48             : namespace
      49             : {
      50             :   AliMUON* muon()
      51             :   {
      52           0 :     return static_cast<AliMUON*>(gAlice->GetModule("MUON"));
      53             :   }
      54             : 
      55             :   void Global2Local(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg,
      56             :                   Double_t& xl, Double_t& yl, Double_t& zl)
      57             :   {  
      58             :   // ideally should be : 
      59             :   // Double_t x,y,z;
      60             :   // AliMUONGeometry::Global2Local(detElemId,xg,yg,zg,x,y,z);
      61             :   // but while waiting for this geometry singleton, let's go through
      62             :   // AliMUON still.
      63             :   
      64           0 :     const AliMUONGeometryTransformer* transformer = muon()->GetGeometryTransformer();
      65           0 :     transformer->Global2Local(detElemId,xg,yg,zg,xl,yl,zl);
      66           0 :   }
      67             : }
      68             : 
      69             : //------------------------------------------------------------------   
      70             : AliMUONResponseTrigger::AliMUONResponseTrigger()
      71          56 :   : AliMUONResponse()
      72         168 : {
      73             : /// Default constructor
      74          56 : }
      75             : 
      76             : //------------------------------------------------------------------   
      77             : AliMUONResponseTrigger::~AliMUONResponseTrigger()
      78           0 : {
      79             : /// Destructor
      80         112 : }
      81             : 
      82             : //_____________________________________________________________________________
      83             : void 
      84             : AliMUONResponseTrigger::DisIntegrate(const AliMUONHit& hit, TList& digits, Float_t /*timeDif*/)
      85             : {
      86             :   /// Generate 2 digits (one on each cathode) from 1 hit, i.e. no cluster-size
      87             :   /// generation (simplest response case).
      88             :   
      89           0 :   digits.Clear();
      90             :   
      91           0 :   Float_t xhit = hit.X();
      92           0 :   Float_t yhit = hit.Y();
      93           0 :   Float_t zhit = hit.Z();
      94           0 :   Int_t detElemId = hit.DetElemId();  
      95             :   
      96           0 :   Double_t x,y,z;
      97           0 :   Global2Local(detElemId,xhit,yhit,zhit,x,y,z);
      98             :   
      99           0 :   Float_t tof = hit.Age();
     100             :   Int_t twentyNano(100);
     101           0 :   if (tof<AliMUONConstants::TriggerTofLimit())
     102             :   {
     103             :     twentyNano=1;
     104           0 :   }
     105             :   
     106             :   Int_t nboard=0;
     107             : 
     108           0 :   for ( Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath )
     109             :   {
     110             :     const AliMpVSegmentation* seg 
     111           0 :       = AliMpSegmentation::Instance()
     112           0 :         ->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
     113             :     
     114           0 :     AliMpPad pad = seg->PadByPosition(x,y,kFALSE);
     115           0 :     Int_t ix = pad.GetIx();
     116           0 :     Int_t iy = pad.GetIy();
     117             :     
     118           0 :     AliDebug(1,Form("xhit,yhit=%e,%e lx,ly,lz=%e,%e,%e ix,iy=%d,%d",
     119             :                     xhit,yhit,x,y,z,ix,iy));
     120             :     
     121           0 :     if ( !pad.IsValid() )
     122             :     {
     123           0 :       AliWarning(Form("hit w/o strip %d-%d xhit,yhit=%e,%e local x,y,z "
     124             :                       "%e,%e,%e ix,iy=%d,%d",detElemId,
     125             :                       cath,
     126             :                       xhit,yhit,x,y,z,ix,iy));
     127           0 :       continue;
     128             :     }
     129             :     
     130           0 :     if ( cath == AliMp::kCath0 ) nboard = pad.GetLocalBoardId(0);
     131             :         
     132           0 :     AliMUONDigit* d = new AliMUONDigit(detElemId,nboard,
     133           0 :                                        pad.GetLocalBoardChannel(0),cath);
     134           0 :     d->SetPadXY(ix,iy);
     135             : 
     136             :     //FIXME : a trigger digit can have several locations. 
     137             :     //this is not currently supported by the digit class. Change that or not ?
     138           0 :     d->SetCharge(twentyNano);
     139             : 
     140             : 
     141           0 :     digits.Add(d);   
     142           0 :   }
     143           0 : }

Generated by: LCOV version 1.11