<commit_before>// $Id$
// Main authors: <NAME> & <NAME>: 2006, 2007

/**************************************************************************
 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
 * full copyright notice.                                                 *
 **************************************************************************/

#include "TROOT.h"
#include "TStyle.h"
#include "TVector.h"
#include "TLinearFitter.h"
#include "TCanvas.h"
#include "TGeoMatrix.h"
#include "TGeoManager.h"

#include "TEveTrans.h"
#include "TEveManager.h"

#include "EveBase/AliEveEventManager.h"

#include "AliEveTRDData.h"
#include "AliEveTRDModuleImp.h"
#include "AliEveTRDLoader.h"
#include "AliEveTRDLoaderImp.h"

#include "AliGeomManager.h"
#include "AliESDtrack.h"
#include "AliLog.h"
#include "AliPID.h"
#include "AliTrackPointArray.h"
#include "AliRieman.h"

#include "AliTRDhit.h"
#include "AliTRDcluster.h"
#include "AliTRDseedV1.h"
#include "AliTRDtrackletMCM.h"
#include "AliTRDtrackletWord.h"
#include "AliTRDmcmSim.h"
#include "AliTRDtrackV1.h"
#include "AliTRDtrackerV1.h"
#include "AliTRDpadPlane.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDmcmSim.h"
#include "AliTRDarrayADC.h"
#include "AliTRDSignalIndex.h"
#include "AliTRDgeometry.h"
#include "AliTRDtransform.h"
#include "AliTRDReconstructor.h"
#include "AliTRDrecoParam.h"

ClassImp(AliEveTRDHits)
ClassImp(AliEveTRDDigits)
ClassImp(AliEveTRDClusters)
ClassImp(AliEveTRDTracklet)
ClassImp(AliEveTRDTrack)
ClassImp(AliEveTRDTrackletOnline)
ClassImp(AliEveTRDmcm)

///////////////////////////////////////////////////////////
/////////////   AliEveTRDDigits       /////////////////////
///////////////////////////////////////////////////////////

//______________________________________________________________________________
AliEveTRDDigits::AliEveTRDDigits(AliEveTRDChamber *p) 
  :TEveQuadSet("digits", "")
  ,fParent(p)
  /*, fBoxes(), fData()*/
{
  // Constructor.   
  SetOwnIds(kTRUE);
  gStyle->SetPalette(1, 0);
  SetPalette(new TEveRGBAPalette(0, 512));
  Reset(TEveQuadSet::kQT_RectangleYZ, kFALSE, 32);
}

//______________________________________________________________________________
AliEveTRDDigits::~AliEveTRDDigits()
{
//  AliInfo(GetTitle());
}

//______________________________________________________________________________
void AliEveTRDDigits::SetData(AliTRDdigitsManager *digits)
{
  // Set data source.

  Int_t det(fParent->GetID());
  AliTRDarrayADC *data = digits->GetDigits(det);
  if(!data->GetDim()) return;
  data->Expand();

  AliTRDSignalIndex *indexes = digits->GetIndexes(det);
  if(!indexes->IsAllocated()) digits->BuildIndexes(det);

  Double_t scale, dy, dz;
  Int_t ly    = AliTRDgeometry::GetLayer(det),
        stk   = AliTRDgeometry::GetStack(det),
        sec   = AliTRDgeometry::GetSector(det),
        vid   = AliGeomManager::LayerToVolUID(AliGeomManager::kTRD1 + ly, stk + AliTRDgeometry::Nstack() * sec);
//  Float_t threshold = fParent->GetDigitsThreshold();
  Short_t sig[7]={0,0,0,10,0,0,0};

  AliTRDtransform transform(det);
  AliTRDpadPlane *pp(fParent->fGeo->GetPadPlane(ly, stk));

  Int_t row, col;
  AliTRDcluster c;
  indexes->ResetCounters();
  while (indexes->NextRCIndex(row, col)){
    dz = pp->GetRowSize(row);
    dy = pp->GetColSize(col);
    Short_t *const adc = data->GetDataAddress(row,col);
    for (Int_t time(0); time<30; time++){     
      if(data->IsPadCorrupted(row, col, time)) break;
      if(adc[time] <= 1) continue;
      new (&c) AliTRDcluster(det, col, row, time, sig, vid);
      transform.Transform(&c);

      scale = adc[time] < 512 ? adc[time]/512. : 1.;
      AddQuad(c.GetY()-0.5*dy, c.GetZ()-0.5*dz*scale, c.GetX(), dy*0.95, dz*scale);
      QuadValue(Float_t(adc[time]));
      QuadId(new TNamed(Form("ADC %d", adc[time]), Form("det[%3d] col[%3d] row[%2d] tb[%2d]", det, col, row, time)));
    } 
  }<commit_msg>add identifiers to digits for readable histos<commit_after>// $Id$
// Main authors: <NAME> & <NAME>: 2006, 2007

/**************************************************************************
 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
 * full copyright notice.                                                 *
 **************************************************************************/

#include "TROOT.h"
#include "TStyle.h"
#include "TVector.h"
#include "TLinearFitter.h"
#include "TCanvas.h"
#include "TGeoMatrix.h"
#include "TGeoManager.h"

#include "TEveTrans.h"
#include "TEveManager.h"

#include "EveBase/AliEveEventManager.h"

#include "AliEveTRDData.h"
#include "AliEveTRDModuleImp.h"
#include "AliEveTRDLoader.h"
#include "AliEveTRDLoaderImp.h"

#include "AliGeomManager.h"
#include "AliESDtrack.h"
#include "AliLog.h"
#include "AliPID.h"
#include "AliTrackPointArray.h"
#include "AliRieman.h"

#include "AliTRDhit.h"
#include "AliTRDcluster.h"
#include "AliTRDseedV1.h"
#include "AliTRDtrackletMCM.h"
#include "AliTRDtrackletWord.h"
#include "AliTRDmcmSim.h"
#include "AliTRDtrackV1.h"
#include "AliTRDtrackerV1.h"
#include "AliTRDpadPlane.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDmcmSim.h"
#include "AliTRDarrayADC.h"
#include "AliTRDSignalIndex.h"
#include "AliTRDgeometry.h"
#include "AliTRDtransform.h"
#include "AliTRDReconstructor.h"
#include "AliTRDrecoParam.h"

ClassImp(AliEveTRDHits)
ClassImp(AliEveTRDDigits)
ClassImp(AliEveTRDClusters)
ClassImp(AliEveTRDTracklet)
ClassImp(AliEveTRDTrack)
ClassImp(AliEveTRDTrackletOnline)
ClassImp(AliEveTRDmcm)

///////////////////////////////////////////////////////////
/////////////   AliEveTRDDigits       /////////////////////
///////////////////////////////////////////////////////////

//______________________________________________________________________________
AliEveTRDDigits::AliEveTRDDigits(AliEveTRDChamber *p) 
  :TEveQuadSet("digits", "")
  ,fParent(p)
{
  // Constructor.
  SetOwnIds(kTRUE);
  gStyle->SetPalette(1, 0);
  SetPalette(new TEveRGBAPalette(0, 512));
  Reset(TEveQuadSet::kQT_RectangleYZ, kFALSE, 32);
}

//______________________________________________________________________________
AliEveTRDDigits::~AliEveTRDDigits()
{
//  AliInfo(GetTitle());
}

//______________________________________________________________________________
void AliEveTRDDigits::SetData(AliTRDdigitsManager *digits)
{
  // Set data source.

  Int_t det(fParent->GetID());
  AliTRDarrayADC *data = digits->GetDigits(det);
  if(!data->GetDim()) return;
  data->Expand();

  AliTRDSignalIndex *indexes = digits->GetIndexes(det);
  if(!indexes->IsAllocated()) digits->BuildIndexes(det);

  Double_t scale, dy, dz;
  Int_t ly    = AliTRDgeometry::GetLayer(det),
        stk   = AliTRDgeometry::GetStack(det),
        sec   = AliTRDgeometry::GetSector(det),
        vid   = AliGeomManager::LayerToVolUID(AliGeomManager::kTRD1 + ly, stk + AliTRDgeometry::Nstack() * sec);
  SetNameTitle(Form("digits%03d", det), Form("det %03d [%02d_%d_%d]", sec, stk, ly));
  Short_t sig[7]={0,0,0,10,0,0,0};

  AliTRDtransform transform(det);
  AliTRDpadPlane *pp(fParent->fGeo->GetPadPlane(ly, stk));

  Int_t row, col;
  AliTRDcluster c;
  indexes->ResetCounters();
  while (indexes->NextRCIndex(row, col)){
    dz = pp->GetRowSize(row);
    dy = pp->GetColSize(col);
    Short_t *const adc = data->GetDataAddress(row,col);
    for (Int_t time(0); time<30; time++){     
      if(data->IsPadCorrupted(row, col, time)) break;
      if(adc[time] <= 1) continue;
      new (&c) AliTRDcluster(det, col, row, time, sig, vid);
      transform.Transform(&c);

      scale = adc[time] < 512 ? adc[time]/512. : 1.;
      AddQuad(c.GetY()-0.5*dy, c.GetZ()-0.5*dz*scale, c.GetX(), dy*0.95, dz*scale);
      QuadValue(Float_t(adc[time]));
      QuadId(new TNamed(Form("ADC %d", adc[time]), Form("det[%3d  [%02d_%d_%d]] col[%3d] row[%2d] tb[%2d]", det, sec, stk, ly, col, row, time)));
    } 
  }
{'fraction_non_alphanumeric': 0.21620612397311426, 'fraction_numerical': 0.01568334578043316, 'mean_word_length': 4.134185303514377, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1977427', 'n_tokens_mistral': 2994, 'n_tokens_neox': 2883, 'n_words': 473}