Esempio n. 1
0
void variation(TH1F* in, TH1F* ref, int iov){

  char inName[128];
  char outName[128];
  TH1F* outH1[4];
  TH2F* outH2;
  TProfile* outP[2];

  strcpy(inName,in->GetTitle());
  SubNamePtr=((strstr(inName,":"))+1);
  sprintf(outName,"IOV_%d/DetId/NoiseVariationProfile_%s_IOV_%d",iov,SubNamePtr,iov);
  outH1[0] = (TH1F*)  outFile_->Get(outName);

  sprintf(outName,"IOV_%d/DetId/NoiseVariation_%s_IOV_%d",iov,SubNamePtr,iov);
  outH1[1] = (TH1F*)  outFile_->Get(outName);

  char tmp[128];
  LayerName(inName,tmp);
  sprintf(outName,"IOV_%d/Layer/NoiseVariation_%s_IOV_%d",iov,tmp,iov);
  outH1[2] = (TH1F*)  outFile_->Get(outName);

  sprintf(outName,"IOV_%d/Layer/NoiseComparison_%s_IOV_%d",iov,tmp,iov);
  outH2 = (TH2F*)  outFile_->Get(outName);

  sprintf(outName,"pNoiseVariation_%s",tmp);
  outP[0] = (TProfile*) outFile_->Get(outName);

  char det[4];
  det[3]='\0';
  strncpy(det,tmp,3);

  sprintf(outName,"IOV_%d/SubDet/NoiseVariation_%s_IOV_%d",iov,det,iov);
  //  cout << outName << endl;
  outH1[3] = (TH1F*)  outFile_->Get(outName);
  
  sprintf(outName,"pNoiseVariation_%s",det);
  outP[1] = (TProfile*) outFile_->Get(outName);
  
  float delta;
  for (int i=1;i<=in->GetNbinsX();i++){
    //    cout << " i = " << i << " " << in->GetBinContent(i) << endl;
    
    if (ref->GetBinContent(i))
      delta=  in->GetBinContent(i)/ref->GetBinContent(i) - 1 ;
    else
      -9999;

    outH1[0]->SetBinContent(i,delta);
    
    for (int j=1;j<4;j++)
      outH1[j]->Fill(delta);

    outH2->Fill(ref->GetBinContent(i),in->GetBinContent(i));

    int iov_= iov;//==10000 ? 2700 : iov;
    for (int j=0;j<2;j++)
      outP[j]->Fill(iov_,delta);

  }
}
Esempio n. 2
0
Layer* OpBackground::CreateBackgroundLayer()
{
	Layer* pNewLayer = new Layer;
	if (pNewLayer != NULL)
	{
		String_256 LayerName(_R(IDS_BACKGROUNDLAYERNAME));

		pNewLayer->SetVisible(TRUE); 
		pNewLayer->SetLocked(TRUE); 
		pNewLayer->SetPrintable(FALSE); 
		pNewLayer->SetBackground(TRUE); 
		pNewLayer->SetOutline(FALSE);
		pNewLayer->SetGuide(FALSE);
		pNewLayer->SetPageBackground(TRUE);		// This is the special page background layer flag
		pNewLayer->SetLayerID(LayerName); 

/*		// Ensure we are always rendered at maximum quality so that turning WYSIWYG
		// down does not remove the page background!
		Quality Qual;
		Qual.SetQuality(QUALITY_MAX);
		QualityAttribute QualAttr(Qual);
		NodeAttribute* pNodeAttr = QualAttr.MakeNode();
		pNodeAttr->AttachNode(pNewLayer, FIRSTCHILD); */
	}

	return pNewLayer;
}
Esempio n. 3
0
 IliClass(CPLXMLNode* node_, int iliVersion_, StrNodeMap& oTidLookup_, ClassesMap& oClasses_, NodeCountMap& oAxisCount_) :
     node(node_), iliVersion(iliVersion_), oTidLookup(oTidLookup_), oClasses(oClasses_), oAxisCount(oAxisCount_),
     poGeomFieldInfos(), poStructFieldInfos(), oFields(), isAssocClass(false), hasDerivedClasses(false)
 {
     char* layerName = LayerName();
     poTableDefn = new OGRFeatureDefn(layerName);
     CPLFree(layerName);
 };
Esempio n. 4
0
void HeeksDxfRead::AddObject(HeeksObj *object)
{
	if (! IsValidLayerName(Ctt(LayerName().c_str())))
	{
		// This is one of the forbidden layer names.  Discard the
		// graphics object and move on.

		delete object;
		return;
	}

	if(wxGetApp().m_in_OpenFile && wxGetApp().m_file_open_matrix)
	{
		object->ModifyByMatrix(wxGetApp().m_file_open_matrix);
	}

	if(m_make_as_sketch)
	{
		// Check to see if we've already added a sketch for the current layer name.  If not
		// then add one now.

		if (m_sketches.find( wxString(Ctt(LayerName().c_str())) ) == m_sketches.end())
		{
			m_sketches.insert( std::make_pair( wxString(Ctt(LayerName().c_str())), new CSketch() ) );
		}

		if(m_current_block)m_current_block->Add(object, NULL);
		else
		{
			object->ModifyByMatrix(m_ucs_matrix);
			m_sketches[wxString(Ctt(LayerName().c_str()))]->Add( object, NULL );
		}
	}
	else
	{
		if(m_current_block)m_current_block->Add(object, NULL);
		else
		{
			object->ModifyByMatrix(m_ucs_matrix);
			if(m_undoable)wxGetApp().AddUndoably(object, NULL, NULL);
			else wxGetApp().Add( object, NULL );
		}
	}
}
Esempio n. 5
0
void ON_Layer::Dump( ON_TextLog& dump ) const
{
  const wchar_t* sName = LayerName();
  if ( !sName )
    sName = L"";
  dump.Print("index = %d\n",m_layer_index);
  dump.Print("name = \"%S\"\n",sName);
  dump.Print("display = %s\n",m_bVisible?"visible":"hidden");
  dump.Print("picking = %s\n",m_bLocked?"locked":"unlocked");
  dump.Print("display color rgb = "); dump.PrintRGB(m_color); dump.Print("\n");
  dump.Print("plot color rgb = "); dump.PrintRGB(m_plot_color); dump.Print("\n");
  dump.Print("default material index = %d\n",m_material_index);
}
Esempio n. 6
0
NoiseEvolution(char* path_, char* RunsList_){


  GetRuns(path_,RunsList_);

  //Open Reference File
  sprintf(refFile,"%s/Display_PedNoise_RunNb_%d.root",path,iov[0]);
  cout << "\nReference File " << refFile << endl;
  refFile_= new TRFIOFile(refFile);

  //Get Histo Names
  refFile_->cd("Noises");
  TIter nextkey(gDirectory->GetListOfKeys());
  TKey *key;
  while (key = (TKey*)nextkey()) {    
    const char * title;
    title=key->GetTitle();
    if (strncmp(title,"Noises_",6)==0 && strstr(title,"Cumulative")== NULL){
      vHistoNames.push_back(string(title));
      vHistoNBinsX.push_back(((TH1F*)key->ReadObj())->GetNbinsX());
      
      char tmp[128];
      LayerName(title,tmp);
      string tmp1(tmp);
      int i=0;
      while (i<vLayerName.size() && tmp1!=vLayerName[i]){i++;}
      if (i==vLayerName.size())
	vLayerName.push_back(tmp1);      
    }
  }

  book();

  
  for (int i=1;i<iovDim;i++){

    sprintf(inFile,"%s/Display_PedNoise_RunNb_%d.root",path,iov[i]);
    cout << "\nAnalyzing File " << inFile << endl;
    inFile_= new TRFIOFile(inFile);
  
    loop(iov[i]);
  }
  
  save();
}
Esempio n. 7
0
void PAKBridge::build() {
  /* First pass: build per-area/per-layer dependency map */
  for (const auto& entry : m_pak.m_entries) {
    const DNAMP2::PAK::Entry& e = entry.second;
    if (e.type == FOURCC('MLVL')) {
      Level& level = m_levelDeps[e.id];

      MLVL mlvl;
      {
        PAKEntryReadStream rs = e.beginReadStream(m_node);
        mlvl.read(rs);
      }
      bool named;
      std::string bestName = m_pak.bestEntryName(m_node, e, named);
      level.name = hecl::SystemStringConv(bestName).sys_str();
      level.areas.reserve(mlvl.areaCount);
      unsigned layerIdx = 0;

      /* Make MAPW available to lookup MAPAs */
      const DNAMP2::PAK::Entry* worldMapEnt = m_pak.lookupEntry(mlvl.worldMap);
      std::vector<UniqueID32> mapw;
      if (worldMapEnt) {
        PAKEntryReadStream rs = worldMapEnt->beginReadStream(m_node);
        rs.seek(8, athena::Current);
        atUint32 areaCount = rs.readUint32Big();
        mapw.reserve(areaCount);
        for (atUint32 i = 0; i < areaCount; ++i)
          mapw.emplace_back(rs);
      }

      /* Index areas */
      unsigned ai = 0;
      for (const MLVL::Area& area : mlvl.areas) {
        Level::Area& areaDeps = level.areas[area.areaMREAId];
        MLVL::LayerFlags& layerFlags = mlvl.layerFlags[ai];
        const DNAMP2::PAK::Entry* areaNameEnt = m_pak.lookupEntry(area.areaNameId);
        if (areaNameEnt) {
          STRG areaName;
          {
            PAKEntryReadStream rs = areaNameEnt->beginReadStream(m_node);
            areaName.read(rs);
          }
          areaDeps.name = areaName.getSystemString(FOURCC('ENGL'), 0);
          areaDeps.name = hecl::StringUtils::TrimWhitespace(areaDeps.name);
        }
        if (areaDeps.name.empty()) {
          areaDeps.name = hecl::SystemStringConv(area.internalAreaName).sys_str();
          if (areaDeps.name.empty()) {
            std::string idStr = area.areaMREAId.toString();
            areaDeps.name = hecl::SystemString(_SYS_STR("MREA_")) + hecl::SystemStringConv(idStr).c_str();
          }
        }
        hecl::SystemChar num[16];
        hecl::SNPrintf(num, 16, _SYS_STR("%02u "), ai);
        areaDeps.name = num + areaDeps.name;

        areaDeps.layers.reserve(area.depLayerCount - 1);
        unsigned r = 0;
        for (unsigned l = 1; l < area.depLayerCount; ++l) {
          areaDeps.layers.emplace_back();
          Level::Area::Layer& layer = areaDeps.layers.back();
          layer.name = LayerName(mlvl.layerNames[layerIdx++]);
          layer.active = layerFlags.flags >> (l - 1) & 0x1;
          layer.name = hecl::StringUtils::TrimWhitespace(layer.name);
          hecl::SNPrintf(num, 16, _SYS_STR("%02u "), l - 1);
          layer.name = num + layer.name;

          layer.resources.reserve(area.depLayers[l] - r);
          for (; r < area.depLayers[l]; ++r)
            layer.resources.emplace(area.deps[r].id);
        }
        areaDeps.resources.reserve(area.depCount - r + 2);
        for (; r < area.depCount; ++r)
          areaDeps.resources.emplace(area.deps[r].id);
        areaDeps.resources.emplace(area.areaMREAId);
        if (mapw.size() > ai)
          areaDeps.resources.emplace(mapw[ai]);
        ++ai;
      }
    }
  }